2 Replies Latest reply on Jul 29, 2010 3:33 AM by Hamel Camille

    Fork and join , bug ?

    Hamel Camille Newbie

      Hi ,

      I'm a newbie in the jbpm world,

      I'm developing a sample process to evaluate Jbpm (4.4 ) but i encounter a lock in my process : i enter a fork ( parallel gateway ) , in this fork , one of the branches has an decision ( XOR Gate )  with 2 branches , and then , every branch goes back to a join.

      The problem is that the XOR branches generate a lock on that join , what would be the appropriate solution ?

       

      Here's my jpdl :

      <?xml version="1.0" encoding="UTF-8"?>

      <process name="arriveDepart" xmlns="http://jbpm.org/4.4/jpdl">
      <swimlane candidate-users="alex,mike,${login}" name="Manager"/>
      <swimlane candidate-users="mary" name="Logistique"/>
      <swimlane candidate-users="mary" name="SI-DRI"/>
      <swimlane candidate-users="mary" name="DSEM"/>
      <swimlane candidate-users="mary" name="I-net"/>

       

         <start form="org/laposte/jbpm/start.html" g="322,16,48,52" name="start1">
            <transition name="to exclusive1" to="exclusive1" g="-68,-18"/>
         </start>
        
         <task form="org/laposte/jbpm/SaisieidRH.html" g="228,184,92,52" name="Saisie idRH" swimlane="Logistique">
            <transition to="join5"/>
         </task>
         <fork g="322,348,48,52" name="fork1">
            <transition to="Saisie badge"/>
            <transition to="Installation poste"/>
            <transition to="Activation i-net"/>
         </fork>
         <task form="org/laposte/jbpm/Saisiebadge.html" g="176,432,92,52" name="Saisie badge" swimlane="Logistique">
            <transition to="join1"/>
         </task>
         <task form="org/laposte/jbpm/Installationposte.html" g="300,432,92,52" name="Installation poste" swimlane="DSEM">
            <transition to="join1"/>
         </task>
         <task form="org/laposte/jbpm/activationI-net.html" g="424,432,92,52" name="Activation i-net" swimlane="I-net">
            <transition to="Création AD"/>
         </task>
         <task form="org/laposte/jbpm/creationAD.html" g="424,516,92,52" name="Création AD" swimlane="DSEM">
            <transition to="exclusive3"/>
         </task>
         <decision g="424,600,92,52" name="exclusive3">
            <transition g="-120,-18" name="to Decision prolongation" to="join1"/>
            <transition to="Liaison PSNEXT">
            <condition expr="#{psnext==&quot;true&quot;}"/>
            </transition>
         </decision>
        
         <task form="org/laposte/jbpm/Liaisonpsnext.html" g="480,699,92,52" name="Liaison PSNEXT" swimlane="SI-DRI">
            <transition g="-120,-18" name="to Decision prolongation" to="join1"/>
         </task>
         <join g="279,848,92,52" name="join1">
            <transition to="Decision prolongation"/>
         </join>
          <task form="org/laposte/jbpm/decisionprolongation.html"  g="279,932,92,52" name="Decision prolongation" swimlane="Manager">
            <transition to="exclusive2"/>
         </task>
         <decision g="140,1314,92,52" name="exclusive5">
            <transition to="Document PSNEXT">
            <condition expr="#{psnext==&quot;true&quot;}"/>
            </transition>
            <transition g="-41,-18" name="to join4" to="join4"/>
         </decision>
         <fork g="162,1096,92,52" name="fork2">
            <transition to="exclusive5"/>
            <transition to="Prolongation badge"/>
         </fork>
         <task form="org/laposte/jbpm/documentpsnext.html" g="27,1237,92,52" name="Document PSNEXT" swimlane="Manager">
            <transition to="Prolongation PSNEXT"/>
         </task>
         <task form="org/laposte/jbpm/prolongationpsnext.html" g="-2,1157,92,52" name="Prolongation PSNEXT" swimlane="SI-DRI">
            <transition g="-41,-18" name="to join4" to="join4"/>
         </task>
          <task form="org/laposte/jbpm/prolongationbadge.html"  g="113,1040,92,52" name="Prolongation badge" swimlane="Logistique">
            <transition to="join4"/>
         </task>
         <join g="410,1096,92,52" name="join2">
            <transition to="Suppression AD"/>
            <transition to="Editions documents"/>
            <transition to="Reprise badge"/>
            <transition to="Enlevement poste"/>
         </join>
         <task g="435,1185,92,52" name="Suppression AD" swimlane="DSEM">
            <transition to="join3"/>
         </task>
         <task g="283,1203,92,52" name="Editions documents" swimlane="Manager">
            <transition to="Suppression services i-net"/>
            <transition to="exclusive7"/>
         </task>
         <task g="534,1180,92,52" name="Reprise badge" swimlane="Logistique">
            <transition to="join3"/>
         </task>
         <task g="358,1403,92,52" name="Suppression PSNEXT" swimlane="SI-DRI">
            <transition to="join8"/>
         </task>
         <decision g="308,1285,92,52" name="exclusive7">
            <transition to="Suppression PSNEXT">
            <condition expr="#{psnext==&quot;true&quot;}"/>
            </transition>
            <transition to="join8"/>
         </decision>
         <task g="381,1274,92,52" name="Suppression services i-net" swimlane="I-net">
            <transition to="join3"/>
         </task>
         <task g="658,1180,92,52" name="Enlevement poste" swimlane="DSEM">
            <transition to="join3"/>
         </task>
         <join g="505,1512,48,52" name="join3">
            <transition to="end1"/>
         </join>
         <end g="505,1596,48,52" name="end1"/>
         <join g="60,967,92,52" name="join4">
            <transition g="-120,-18" name="to Decision prolongation" to="Decision prolongation"/>
         </join>
         <decision g="301,1016,48,48" name="exclusive2">
            <transition to="fork2">
            <condition expr="#{prolongation==&quot;true&quot;}"/>
            </transition>
            <transition to="join2"/>
         </decision>
         <join g="322,268,48,48" name="join5">
            <transition to="fork1"/>
         </join>
         <join g="287,1483,48,48" name="join8">
            <transition to="join3"/>
         </join>
         <decision name="exclusive1" g="333,121,48,48">
            <transition to="Saisie idRH">
            <condition expr="#{idrh==&quot;&quot;}"/>
            </transition>
            <transition to="join5">
            </transition>
         </decision>
      </process>

       

       

       

       

       

      ( the lock is on join1 )

        • 1. Re: Fork and join , bug ?
          HuiSheng Xu Master

          Hi Hamel,

           

          By default,  JoinActivity used its incomming transitions to decide when execution need to continue.

           

          So for the 'join5', you shouldn't add a join under decision,  because there were two incomming transitions in join5,  join5 will wait for two executions arrived it and let execution continue to next step.  but decision won't create any child execution,  so there will be always one execution arrived on join5,  but join5 didn't know that,  it will go on waiting for the second execution,  then the whole process instance was blocked.

           

          Please notice that, you should use join only after a fork activity.

           

          The join1 is another situation.  As mentioned before,  join used its incomming transitions to decide when to continue.  There are four incomming transitions on join1,  but then only three child execution being created by fork on the runtime,  so we have to set multiplicity=3 on join1,  so join1 could know if there are 3 child execution arrived , then the execution should continue to next step.

           

           

          Cheers.

          • 2. Re: Fork and join , bug ?
            Hamel Camille Newbie

            Thank you , i didn't know about the multiplicity option , it was the solution

            For the join 5 , i don't know why but it worked flawlessly , guess i was lucky