8 Replies Latest reply on May 10, 2006 5:13 AM by Sidd Shetty

    Using Decision Successfully....

    Sidd Shetty Newbie


      i have trying to use the decision node wherein if the entered value is "less" it goes to a task node and does something or if its "greater" , it goes to a different one....

      This is the code

      <?xml version="1.0" encoding="UTF-8"?>
       xmlns="urn:jbpm.org:jpdl-3.1" name="Trial">
       <swimlane name="checker">
       <assignment expression="user(grover)"></assignment>
       <swimlane name="lessthan">
       <assignment expression="user(ernie)"></assignment>
       <swimlane name="greaterthan">
       <assignment expression="user(bert)"></assignment>
       <start-state name="start">
       <task name="Send Item">
       <variable name="tracking number" access="read,write,required"></variable>
       <transition name="Go" to="EnterAmt"></transition>
       <task-node name="EnterAmt">
       <task name="SubmitAmt" swimlane="checker">
       <variable name="Amount" access="read,write,required" mapped-name="decisionVariable"/>
       <transition name="CheckAmt" to="VerifyAmt"></transition>
       <decision name="VerifyAmt">
       <transition name="Less" to="File LessThan">
       <condition>decisionVariable == 'less' </condition>
       <transition name="Greater" to="File GreaterThan">
       <condition>decisionVariable == 'greater' </condition>
       <task-node name="File LessThan">
       <task name="CreateLess" swimlane="lessthan" ></task>
       <event type="node-leave">
       <action name="create file" class="savefile.SaveFile"></action>
       <transition to="join1"></transition>
       <task-node name="File GreaterThan">
       <task name="CreateGreater" swimlane="greaterthan"></task>
       <event type="node-leave">
       <action name="create file2" class="savefile2.SaveFile2"></action>
       <transition to="join1"></transition>
       <join name="join1">
       <transition to="Finish"></transition>
       <end-state name="Finish"></end-state>

      Is my code wrong becoz I have been trying everything which is given in the guide and also thru all the posts in this forum like using

      <condition expression="#contextInstance.variables['decisionVariable'] eq 'greater'"/>

      But still its not working and irrespective of the values entered it goes to the first task ie "File LessThan" .......am not getting any errors as such....Any pointers to this....

      I am using ::
      Java 1.4.3

      Thanks and Regards