1 Reply Latest reply on May 18, 2006 7:53 PM by Greg McGregor

    decision node condition

    Greg McGregor Newbie

      I am having a problem executing a condition tag in a decision node and would appreciate an insight from anyone.

      A task is ended as follows, which creates a process instance variable and sets the return value in it.

      taskInstance.getContextInstance().setVariable("approved", "yes");
      taskInstance.end();
      


      Next, the execution proceeds into a decision node:

      <decision name="decision1">
       <event type="node-leave">
       <action name="update_order_status" class="jbpm.UpdateOrderStatusAction"/>
       </event>
       <transition name="reject" to="Reject Request">
       <condition expression='contextInstance.getVariable("approved").equals("no") '/>
       </transition>
       <transition name="approve" to="Approve Request">
       <condition expression='contextInstance.getVariable("approved").equals("yes") '/>
       </transition>
       </decision>


      The problem I am seeing is that the condition seems never have been evaluated, and the execution always goes into the first transition.

      14:46:18,558 [main] DEBUG GraphElement : event 'node-enter' on 'Decision(decision1)' for 'Token(/)'
      14:46:18,558 [main] WARN StatefulPersistenceContext : Narrowing proxy to class org.jbpm.graph.node.Decision - this operation breaks ==
      14:46:18,668 [main] DEBUG Decision : no transition name selected: taking default leaving transition
      14:46:18,668 [main] DEBUG GraphElement : event 'node-leave' on 'Decision(decision1)' for 'Token(/)'
      14:46:18,683 [main] DEBUG GraphElement : executing action 'action[update_order_status]'
      ********** UpdateOrderStatusAction fired ******
      14:46:18,683 [main] DEBUG GraphElement : event 'transition' on 'Transition(reject)' for 'Token(/)'


      Any pointer will be appreciated.


        • 1. Re: decision node condition
          Greg McGregor Newbie

          This is just a follow-up.

          I got the decision node behave correctly by using DecisionHandler class.

          <decision name="decision1">
           <event type="node-leave">
           <action name="update_order_status" class="jbpm.UpdateOrderStatusAction"/>
           </event>
           <handler class="jbpm.PurchaseDecisionHandler"/>
           <transition name="reject" to="Reject Request" />
           <transition name="approve" to="Approve Request" />
           </decision>


          I tried various forms of EL expressions to no avail...