2 Replies Latest reply on Feb 27, 2006 2:50 AM by mennen

    3.1: trouble with fork +processInstance.signal()

    mennen

      Hi,

      I've been trying to signal "processInstance.signal(transitionName)" a processInstance that contains a fork, and it's not working as expected.
      It keeps telling me that the transition is Null. When i do processInstance.signal(), without specifying the transition Name, it works..
      Really weird..

      I tried to do the same thing without the fork, and it worked! So it seems to me that it has to do with the fork.. Is there a specificity of the fork that i'm missing? Do i have to signal it an extra time just for the fork?

      Thanks in advance,

      ____________________________________________________________

      Here is the initial processDefinition that has no forks (and that works):

      <?xml version="1.0" encoding="UTF-8"?>
      
      <process-definition name="Subprocess_waitStates">
      
       <swimlane name="role1" />
      
       <start-state name="start state process testing">
       <task swimlane="role1">
       <controller>
       <variable name="numCmde" />
       </controller>
       </task>
       <transition name="" to="task1"></transition>
       </start-state>
      
       <task-node name="task1">
       <task swimlane="role1">
       <controller>
       <variable name="numCmde" />
       </controller>
       </task>
       <transition name="" to="node1"></transition>
       </task-node>
      
       <state name="node1">
       <!--timer duedate="1 minute" transition="choix2" /-->
       <transition name="choix1" to="task2"></transition>
       <transition name="choix2" to="task3"></transition>
       </state>
      
       <task-node name="task2">
       <task swimlane="role1">
       <controller>
       <variable name="numCmde" />
       </controller>
       </task>
       <transition name="" to="task5"></transition>
       </task-node>
      
       <end-state name="end1"></end-state>
      
       <task-node name="task3">
       <task swimlane="role1">
       <controller>
       <variable name="numCmde" />
       </controller>
       </task>
       <transition name="" to="task5"></transition>
       </task-node>
      
       <task-node name="task5">
       <task swimlane="role1">
       <controller>
       <variable name="numCmde" />
       </controller>
       </task>
       <transition name="" to="end1"></transition>
       </task-node>
      
      
      </process-definition>


      And here is the one that has the fork (and that doesn't work when i do processInstance.signal()


      <?xml version="1.0" encoding="UTF-8"?>
      
      <process-definition name="Subprocess_waitStates">
      
       <swimlane name="role1" />
      
       <start-state name="start state process testing">
       <task swimlane="role1">
       <controller>
       <variable name="numCmde" />
       </controller>
       </task>
       <transition name="" to="task1"></transition>
       </start-state>
      
       <task-node name="task1">
       <task swimlane="role1">
       <controller>
       <variable name="numCmde" />
       </controller>
       </task>
       <transition name="tr2" to="fork1"></transition>
       </task-node>
      
      <fork name="fork1">
       <transition name="" to="node1"></transition>
       </fork>
      
       <state name="node1">
       <!--timer duedate="1 minute" transition="choix2" /-->
       <transition name="choix1" to="task2"></transition>
       <transition name="choix2" to="task3"></transition>
       </state>
      
       <task-node name="task2">
       <task swimlane="role1">
       <controller>
       <variable name="numCmde" />
       </controller>
       </task>
       <transition name="" to="task5"></transition>
       </task-node>
      
       <join name="join1">
       <transition name="" to="end1"></transition>
       </join>
      
       <end-state name="end1"></end-state>
      
       <task-node name="task3">
       <task swimlane="role1">
       <controller>
       <variable name="numCmde" />
       </controller>
       </task>
       <transition name="" to="task5"></transition>
       </task-node>
      
       <task-node name="task5">
       <task swimlane="role1">
       <controller>
       <variable name="numCmde" />
       </controller>
       </task>
       <transition name="tr2" to="join1"></transition>
       </task-node>
      
      
      
      </process-definition>


        • 1. Re: 3.1: trouble with fork +processInstance.signal()
          osama.abdelkarim

          I am still a beginner in JBPM, but I will try to answer. When the token reaches the fork, the fork send child token to each transition with the name of the transition. Thus, in order to continue the process execution, you need to signal the child token.

          This could be done by typing the line:
          instance.findToken("/tr1").signal();

          where tr1 is the name of the transition goin out from the Fork Node.

          • 2. Re: 3.1: trouble with fork +processInstance.signal()
            mennen

            Thank you so much for helping me out.. you were right indeed.
            Instead of

            processInstance.signal(transitionName);

            I put
            processInstance.findToken("/tr").signal(transitionName);

            where "tr" is the
            name of the transition goin out from the Fork Node.




            And it worked!

            Again, thank you!