1 2 Previous Next 20 Replies Latest reply on Jul 31, 2009 11:33 AM by kukeltje Go to original post
      • 15. Re: [jBPM 4] Mai templates context variables
        tejjbpm

        But you are not using an event as we suggested..try this and let us know how you get on..

        My initial example:
        <event type="task-notification"> <mail name="mailtest" to="fdds@jfgj.com">
         <subject>Hello, there</subject>
         <text>Task instance name #{taskInstance.name} </text>
        </mail>
        </event>


        • 16. Re: [jBPM 4] Mai templates context variables
          gleenders

          Sorry for not mentioning it in my previous post but I also tried the following

          <task duedate="10 seconds" g="36,108,97,52" name="Visa Conseiller">
           <assignment-handler class="be.axi.bpm.handlers.TaskAssignmentHandler"/>
           <on event="task-notification"><mail template="mail-task-assign"/></on>
           <reminder duedate="15 seconds"/>
           <transition g="-76,-12" name="to Inspection" to="Inspection"/>
          </task>
          
          <mail-template name="mail-task-assign">
           <to addresses="xxx@xxx.be" />
           <subject>Assignment notification (E-C)</subject>
           <text>Task assigned</text>
           </mail-template>
          
          


          But this code does nothing at all... It's maybe like kukeltje said:

          I'm not 100% sure a mail element can be nested in a 'on' element in 4.



          • 17. Re: [jBPM 4] Mai templates context variables
            tejjbpm

            hmm..i am running out of ideas...

            I had the same requirement but I have acheive it it in JBPM 3 with an event...I think things have changed considerably in JBPM 4..

            In JBPM 3 the task assignment mail template and event was called with the same name "task-assign" so I dint have any problem..The last piece of advice I would give is to find the event associated with the task assignment..and to find out how to trigger an event from the code as yours does not seem to do anything (probably the syntax is wrong)

            • 18. Re: [jBPM 4] Mai templates context variables
              kukeltje

              I've been mislead also. https://jira.jboss.org/jira/browse/JBPM-2254

              Thought that notification and reminder accepted a template attribute, but looking at the xsd, they don't.

              BUT... according to the source it should work. So try something like I mentioned before:

              <task duedate="10 seconds" g="36,108,97,52" name="Visa Conseiller">
               <assignment-handler class="be.axi.bpm.handlers.TaskAssignmentHandler"/>
               <notification template="MyTaskNotification"/>
               <reminder duedate="15 seconds"/>
               <transition g="-76,-12" name="to Inspection" to="Inspection"/>
              </task>
              
              <mail-template name="MyTask-notification">
               <to addresses="xxxx@xxxi.be" />
               <subject>Assignment notification (E)</subject>
               <text>Task assigned</text>
              </mail-template>
              
              


              And if embedding the template in the pd does not work, try putting the template in the config file.

              • 19. Re: [jBPM 4] Mai templates context variables
                kukeltje

                Oh, you might want to remove the xsd reference in the pd to make this work (it circumvents validation against the xsd)

                • 20. Re: [jBPM 4] Mai templates context variables
                  kukeltje

                  Can someone other then me check if it works now against svn-trunk. So not removing of the xsd should be needed and no specifying of a template on reminder to get the right template being used.

                  1 2 Previous Next