5 Replies Latest reply on May 8, 2008 4:35 PM by shettytejesh

    fork (concurrency) help

    shettytejesh

      I have a fork which produced three transition and all go to an automated node. My understanding here is that there will be three thread of execution path generated. Each thread(transition) is going to an automated node then I am joining all three and moving ahead.

      Right now I have automated node pointing to same action handler which simply prints stuff on the system.out. I was hoping to see concurrent logs of these three execution thread, but instead I am seeing one thread at a time ( second thread logs is printed when first one finishes its action).

      Although when joining, even though when first thread is completed n comes to join node it does wait till other two thread finishes. So this looks like working as expected but I am not sure of it because of non-concurrent logs.

      Any help/thoughts will be greatly appreciated.

      Thanks.

        • 1. Re: fork (concurrency) help
          shettytejesh

          heres snippet of xml which explains what i am doing....xml is schematically not correct but will give picture on what i am trying to achieve ..








































          • 2. Re: fork (concurrency) help
            shettytejesh

             

            <fork name='split'>
             <transition to='a' />
             <transition to='b' />
             <transition to='c' />
             </fork>
             <node name='a'>
             <event type='node-enter'>
             <action class='ActionHAndler' />
             </event>
             <transition to='joinit'>
             <action class='TransitionActionHandler' />
             </transition>
             </node>
             <node name='b'>
             <event type='node-enter'>
             <action class='ActionHAndler' />
             </event>
             <transition to='joinit'>
             <action class='TransitionActionHandler' />
             </transition>
             </node>
             <node name='c'>
             <event type='node-enter'>
             <action class='ActionHAndler' />
             </event>
             <transition to='joinit'>
             <action class='TransitionActionHandler' />
             </transition>
             </node>
             <join name="joinit">
             <event type='node-enter'>
             <action class='EnterJoinActionHandler' />
             </event>
             <event type='node-leave'>
             <action class='LeaveJoinActionHandler' />
             </event>
             <transition name="join-to-end" to='end' />
             </join>
            


            • 3. Re: fork (concurrency) help
              kukeltje

              jbpm does *not* make multiple threads for each of the legs of the forks.

              • 4. Re: fork (concurrency) help

                Adding async="true" to the node on each leg will make it execute independently. I don't know how/if this works if you are not persisting; someone else may know. If you are persisting, you'll need to use a database with good isolation and transaction characteristics - in particular, not HSQL.

                • 5. Re: fork (concurrency) help
                  shettytejesh

                  After posting my question and going through the jbpm doc, I did understood the GOP execution strategy and realized I will have to use async='true'.

                  Thanks for the help.