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

    How To close task from FreeMarker template?

    Oleg Ladizhensky Newbie

      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>