Actually, If I had specified the wrong transition, it would have gone to the 
wrong node - but I don't find that happening ! The transition name is correct, 
and it also goes to the right node - as evidenced by my logs, where I print the 
name of the last node from my action handler on event 'process-end'.

As for my code - it's very simple: 

  | 
  | public class GenericAssignmentHandler implements AssignmentHandler {
  | 
  |  public void assign(Assignable assignable, ExecutionContext 
executionContext)
  |         throws Exception {
  | 
  | ...
  | ...
  | 
  | 
  |         if (startAndEndTask) {
  | 
  |             log.info("-----------starting and ending task-------------");
  | 
  |             // start and finish the task right here.
  |             ((TaskInstance) assignable).start();
  | 
  |             ((TaskInstance) assignable)
  |                 .end("Approved");
  |         } 
  |  log.info("------------done assignment handler----------");
  | 
  | }
  | 
  | 
  | 

And my process definition looks like:


  | 
  | <?xml version="1.0" encoding="UTF-8"?>
  | 
  | <process-definition xmlns="" name="NewSimpleProcess">
  |     <start-state name="start">
  |             <transition name="" to="Level1Approval"></transition>
  |     </start-state>
  | 
  | 
  | 
  |     <task-node name="Level1Approval">
  | 
  |             <task name="Level1ApprovalTask">
  | 
  |                     <assignment
  |                             class="GenericAssignmentHandler">
  |                                                     </assignment>
  | 
  | 
  |                     
  |             </task>
  | 
  | 
  |             <transition name="Approved" to="Level2Approval"></transition>
  |             <transition name="Denied" to="Denied"></transition>
  |     </task-node>
  | 
  | 
  | 
  |     <task-node name="Level2Approval">
  | 
  |             <task name="Level2ApprovalTask">
  |                     <assignment
  |                             class="GenericAssignmentHandler">
  |                             
  |             </task>
  | 
  | 
  |             
  |             <transition name="Denied" to="Denied"></transition>
  |             <transition name="Approved" to="Approved"></transition>
  |     </task-node>
  | 
  | 
  | 
  |     <end-state name="Approved"></end-state>
  |     <end-state name="Denied"></end-state>
  | 
  |     <event type="process-end">
  |             <action
  |                     class="GenericProcessEndHandler">
  |             </action>
  |     </event>
  | 
  | 
  | </process-definition>
  | 

Now, if I place transition Denied before Approved in my last node, it 
highlights denied, and if Approved appears first, it highlights approved !! And 
I *am* passing the transition name when I end the task. Am I making some 
obvious blunder here ?

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4095240#4095240

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4095240
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to