3 Replies Latest reply on Aug 29, 2009 3:19 PM by pektop

    How To close task from FreeMarker template?

      Hello,
      Assume that this is wide-spread question, but I cannot find the answer nether in documentation or in forum. The problem is that I cannot close the task to pass the transition workflow to the next task. I used taskFormExample and just added new task which uses some "dummy" form with only one button. Now when transition comes to this task from "Start" element it stops there and not going to "verify_request" task.

      - What action/element should be used to close task and go to another task if .ftl template is used?

      Thanks in advance,

      Oleg Ladizhensky


      press_the_button.ftl

      <html>
      <body>
       <form action="${form.action}" method="POST" enctype="multipart/form-data">
       <input type="submit" name="Done"/>
      </form>
      </body>
      </html>
      


      process.jpdl.xml
      <?xml version="1.0" encoding="UTF-8"?>
      
      <process name="taskformExample_2" xmlns="http://jbpm.org/4.0/jpdl">
       <start form="be/jorambarrez/jbpm4/demo/taskform/request_vacation.ftl" g="262,16,48,48" name="start">
       <transition to="PressTheButton" g="-94,-18"/>
       </start>
       <task g="222,96,129,52" name="PressTheButton" candidate-users="peter,mary" form="be/jorambarrez/jbpm4/demo/taskform/press_the_button.ftl">
       <transition name="to verify_request" to="verify_request" g="-89,-18"/>
       </task>
       <task candidate-users="peter,mary" form="be/jorambarrez/jbpm4/demo/taskform/verify_request.ftl" g="223,180,126,52" name="verify_request">
       <transition g="40,-14" name="accept" to="Send acceptance e-mail"/>
       <transition g="-44,-17" name="reject" to="Send rejection e-mail"/>
       <transition g="-18,-20" name="Empty" to="Send Empty e-mail"/>
       </task>
       <mail g="16,264,157,40" name="Send rejection e-mail">
       <to addresses="${employee_email}"/>
       <subject>Your vacation request has been rejected</subject>
       <text>Your vacation request for ${number_of_days} has been rejected. Reason: ${reason}</text>
       <transition to="vacation_rejected"/>
       </mail>
       <mail g="205,264,163,40" name="Send acceptance e-mail">
       <to addresses="${employee_email}"/>
       <subject>Your vacation request has been accepted</subject>
       <text>Success: your vacation request for ${number_of_days} has been accepted.</text>
       <transition to="vacation_accepted"/>
       </mail>
       <end g="70,336,48,48" name="vacation_rejected"/>
       <end g="262,336,48,48" name="vacation_accepted"/>
      
       <mail g="400,264,163,40" name="Send Empty e-mail">
       <to addresses="${employee_email}"/>
       <subject>Your vacation request has been accepted</subject>
       <text>Success: your vacation request for ${number_of_days} has been accepted.</text>
       <transition to="end1"/>
       </mail>
      
      
       <end g="457,336,48,48" name="end1"/>
       <task g="222,96,129,52" name="PressTheButton" candidate-users="peter,mary" form="be/jorambarrez/jbpm4/demo/taskform/press_the_button.ftl">
       <transition name="to verify_request" to="verify_request" g="-89,-18"/>
       </task>
      </process>
      




        • 1. Re: How To close task from FreeMarker template?
          kukeltje

           

          "pektop" wrote:
          Hello,
          "pektop" wrote:

          Hi
          "pektop" wrote:

          Assume that this is wide-spread question, but I cannot find the answer nether in documentation or in forum.

          Well, maybe it is not a widespread question like you think to be sure of it is ;-)
          "pektop" wrote:

          - What action/element should be used to close task and go to another task if .ftl template is used?


          Have a look at the example forms


          • 2. Re: How To close task from FreeMarker template?
            kukeltje

            sorry for the wrong quoting

            • 3. Re: How To close task from FreeMarker template?

              Thanks, Roland. Indeed in this example only one form (verify_request.ftl) contains solution showing how to pass workflow from this form to next element. Am I understand correct that if in template only input with the name "utcome" will be recognized by transition element of jpdl file?

              <input type="submit" name="outcome" value="${transition}">
              

              As I understood, from the start element workflow will be automatically passed to next element on any input, and there is no need to call it exactly "outcome". But in task elements it should already be called "outcome".

              BR
              Oleg Ladizhensky