10 Replies Latest reply on May 21, 2009 5:27 AM by Eman Nollase

    Join Problem

    Swati S Newbie

      Hi,
      In a process I'm using fork for parallel activities and one join. After join there is system activity. But when I create instance of process and process completes 2 parallel activities it still stucks to the join node. Its not moving to the next system activity.
      What could be the problem??

        • 1. Re: Join Problem
          Ronald van Kuijk Master

          show your processdefinition and even better, a full unittest with embedded processdefinition (as a string), actionhandlers as inner classes etc....

          • 2. Re: Join Problem
            Swati S Newbie

             

            <fork name="fork1">
             <transition name="" to="Scoring"></transition>
             <transition name="tr2" to="RealEstateProcInvoke"></transition>
             </fork>
             <node name="Scoring">
             <action class="com.sample.action.handler.CalculatorActionHandler">
             <method>getScore</method>
             <wsdlURL>http://localhost:9090/CalculatorApp/CalculatorWebServiceService?wsdl</wsdlURL>
             </action>
             <transition name="" to="join1"></transition>
             </node>
             <process-state name="WebSaleProcInvoke">
             <sub-process name="websale" version="1"></sub-process>
             <variable name="cname" access="read,write" />
             <transition name="" to="join1"></transition>
             </process-state>
             <join name="join1">
             <transition name="" to="File Adapter"></transition>
             </join>
             <node name="FileAdapter">
             <action class="com.sample.action.handler.FileActionHandler"></action>
             <transition name="" to="Decision 3"></transition>
             </node>


            • 3. Re: Join Problem
              Joram Barrez Master

              Is this the complete process def?
              There is no node called 'RealEstateProcInvoke', which is one of the parallel activities.

              Nonetheless, my guess is that you probably forgot to add execution.leaveNode() at the end of your custom actionHandler.

              • 4. Re: Join Problem
                Swati S Newbie

                you are right its not complete code... i just put only part of code... in actionhandler i used

                executionContext.getProcessInstance().signal();
                statement at the end. My question is if these two parallel activities gets completed why join node is still waiting to send signal to the next activity.

                • 5. Re: Join Problem
                  Joram Barrez Master

                  Are you sure the actions are completely finished. Check your database to see in which node your token is.

                  Also, executionContext.getProcessInstance().signal(); is going to give you strange behaviour since now you are signalling the root token. Try to use executionContext.leaveNode().

                  • 6. Re: Join Problem
                    Swati S Newbie

                    ok i iwll try to use executionContext.leaveNode() instead of signal method... will update u in few mins...

                    • 7. Re: Join Problem
                      Swati S Newbie

                      you are right about the signal method. I tried another small process with action handlers.In action hanlder classes i used once leaveNode method it worked perfectly. But when I changes leaveNode method to signal method got the same problem. thanks .. able to fix this one...

                      • 8. Re: Join Problem
                        Eman Nollase Newbie

                        Hi,

                        I have same problem. here is my process definition:

                        <?xml version="1.0" encoding="UTF-8"?>
                        <process-definition xmlns="" name="forktest">
                         <description>
                         a test for fork/join workflow
                         </description>
                         <start-state name="Start">
                         <transition to="fork"></transition>
                         </start-state>
                         <fork name="fork">
                         <transition to="approver A" name="to approver A"></transition>
                         <transition to="approver B" name="to approver B"></transition>
                         </fork>
                        
                         <task-node name="approver A">
                         <task name="FORKAPPRVA">
                         <description>
                         Please approve A
                         </description>
                         <assignment class="com.ccti.los.WfAssignment">
                         <pooledactors>
                         CORBANK
                         </pooledactors>
                         </assignment>
                         <controller class=""></controller>
                         </task>
                         <transition to="join"></transition>
                         </task-node>
                        
                         <task-node name="approver B">
                         <task name="FORKAPPRVB">
                         <description>
                         Please approve B
                         </description>
                         <assignment class="com.ccti.los.WfAssignment">
                         <pooledactors>
                         APPROVERS
                         </pooledactors>
                         </assignment>
                         </task>
                         <transition to="join"></transition>
                         </task-node>
                        
                         <join name="join">
                         <transition to="Review Document"></transition>
                         </join>
                        
                         <task-node name="Review Document">
                         <task name="FORKREVDOC">
                         <description>
                         Document for review
                         </description>
                         <assignment class="com.ccti.los.WfAssignment">
                         <pooledactors>
                         REVIEWER
                         </pooledactors>
                         </assignment>
                         </task>
                         <transition to="End"></transition>
                         </task-node>
                        
                         <end-state name="End"></end-state>
                        </process-definition>
                        

                        ...the two task had already completed/signaled but got stuck on join.
                        any idea?

                        Thanks a lot.
                        Cheers.


                        • 9. Re: Join Problem
                          Swati S Newbie

                          in your processdefinition xml "controller class attribute is blank" how come you were able to complete the two parallel task? after removing controoler class tag from xml the process instance ended sucussfully.

                          • 10. Re: Join Problem
                            Eman Nollase Newbie

                            Ok. i do not put a controller class because i use WfEngine for that. Here is some wfengine works:

                            
                            final String taskInstanceId = BPMEngineRegistry.getLocalId(wfTask.id);
                            
                            ............
                            
                            wfEngine.signal(wfTask.path.id, null);
                            wfEngine.endTask(taskInstanceId, null);
                            


                            that line of code works (signalling to another task) for process that not in fork/join context. Should I add a taskcontrollerhandler to be able to work?

                            Thanks a lot.
                            Cheers.