1 2 3 4 5 Previous Next 60 Replies Latest reply on Dec 11, 2005 9:35 AM by chprvkmr Go to original post
      • 15. Re: Simultaneous execution of  Fork children
        koen.aers

        Not correct. If you have multiple states, they will execute in parallel. If you have normal nodes they will execute deterministically. Again, the multiple tokens created by a fork are not equivalent to threads. Remember that jBPM is not a thread manager, it is a workflow engine.
        So to answer your question, accomplishing parallel execution is simple using states, process-states or task-nodes. Or simple nodes combined with asynchronous communication to other systems.

        Regards,
        Koen

        • 16. Re: Simultaneous execution of  Fork children
          chprvkmr

          Hi Koen,

          You saved my life.

          accomplishing parallel execution is simple using states, process-states or task-nodes


          Thats really great. It would be fine if this illustrated with some simple examples. This is the area where many people have lots of confusions. Actually by seeing this long discussion [2 pages ;)- ] it gives an impression that accomplishing parallel execution is difficult.


          Remember that jBPM is not a thread manager, it is a workflow engine.


          What I feel is in business process management, executing concurrent processes (simultaneously) is also of primary concern.

          Thanks in advance,


          • 17. Re: Simultaneous execution of  Fork children
            kukeltje

             

            "chprvkmr" wrote:
            Hi Koen,

            You saved my life.


            Yes, Koen is blond, d-cup, wears an orange bathingsuit and lives in california :-)

            "chprvkmr" wrote:
            Thats really great. It would be fine if this illustrated with some simple examples. This is the area where many people have lots of confusions. Actually by seeing this long discussion [2 pages ;)- ] it gives an impression that accomplishing parallel execution is difficult.

            I have to disagree. Not many people have lots of confusions here. It is the first time in over 1.5 years that this is discussed this long. And don't get me wrong. I do not want to play down this issue, your knowledge or whatever. It's just that things are possible in a not to difficult way and yes, with 3.1 we included async functionality in the engine since we noticed there was a big demand and an example will be included

            "chprvkmr" wrote:

            Remember that jBPM is not a thread manager, it is a workflow engine.


            What I feel is in business process management, executing concurrent processes (simultaneously) is also of primary concern.


            Again, and I have to back up Koen here, parallel execution of processes IS simple. parallel execution of actions in 'parallel' states in forks is a bit more difficult. But that is also the case in plain j2ee. There you create threads or jms, here you make sure your actionHandler does not implement all logic by itself but 'triggers' (via JMS?) some other piece of businesslogic.

            Again... not to difficult. Yes other BPMS have implemented this differently. They use their own threadpools/managers etc... which leeds to issues in that area.


            • 18. Re: Simultaneous execution of  Fork children
              koen.aers

               

              Yes, Koen is blond, d-cup, wears an orange bathingsuit and lives in california :-)

              Jealous Ronald? :-P

              By the way, I just stumbled across a question regarding this issue in our FAQ today. Seems I read these not enough myself. Have a look at
              http://wiki.jboss.org/wiki/Wiki.jsp?page=JbpmForkFAQ.

              Regards,
              Koen

              • 19. Re: Simultaneous execution of  Fork children
                kukeltje

                Jealous? It depends Koen, are you female?

                • 20. Re: Simultaneous execution of  Fork children
                  koen.aers

                  Anything I would answer on this bears the danger of a chapter VII complaint ;-)

                  • 21. Re: Simultaneous execution of  Fork children
                    chprvkmr

                    Hi,

                    Thanks for your reply. We tried to execute 2 processes parallely with below process definition.

                    After fork1, state-2 and state-4 were assigned to users, praveen and siddarth respectively. Once they
                    closed their respective task(clicking 'save and close' button), both states state-3 and state-5 (equipped with actions) started running parallely and the process instance ended fine.

                    Here we noticed that along with 2 parallel process even SchedulerThread is going fine, checking for timers

                    NOTE:: ->Here action class, com.sample.webapp.demo1.ReadFile simply reads a file and displays it in console
                    ->Input file contains numbers 1 to 65536 serially, each in a line.



                    Input file
                    1
                    2
                    .....
                    65536


                    Process Definition
                    <?xml version="1.0" encoding="UTF-8"?>
                    
                    <process-definition name="egjointest5">
                    
                     <!-- SWIMLANES (= process roles) -->
                     <swimlane name="user1">
                     <assignment expression="user(praveen)" />
                     </swimlane>
                    
                     <swimlane name="user2">
                     <assignment expression="user(siddarth)" />
                     </swimlane>
                    
                     <swimlane name="user3">
                     <assignment expression="user(shaileshraval)" />
                     </swimlane>
                    
                     <swimlane name="user4">
                     <assignment expression="user(rajeev)" />
                     </swimlane>
                    
                     <!-- NODES -->
                    
                     <start-state name="state-1">
                     <task>
                     <controller>
                     <variable name="initiatorname" />
                     <variable name="fileName" />
                     <variable name="pathName" />
                     </controller>
                     </task>
                     <transition to="fork1" />
                     </start-state>
                    
                     <fork name="fork1">
                     <transition name="to state-2" to="state-2" />
                     <transition name="to state-4" to="state-4" />
                     </fork>
                    
                     <task-node name="state-2">
                     <task swimlane="user1">
                     <controller>
                     <variable name="initiatorname" access="read"/>
                     <variable name="state-2-yourname"/>
                     </controller>
                     </task>
                     <transition to="state-3" />
                     </task-node>
                    
                     <node name="state-3">
                     <action class="com.sample.webapp.demo1.ReadFile">
                     <msg>Action node Triggered For Reading File state-3</msg>
                     </action>
                     <transition name="to join1" to="join1" />
                     </node>
                    
                     <task-node name="state-4">
                     <task swimlane="user2">
                     <controller>
                     <variable name="initiatorname" access="read"/>
                     <variable name="state-4-yourname"/>
                     </controller>
                     </task>
                     <transition to="state-5" />
                     </task-node>
                    
                     <node name="state-5">
                     <action class="com.sample.webapp.demo1.ReadFile">
                     <msg>Action node Triggered For Reading File state-5</msg>
                     </action>
                     <transition name="to join1" to="join1" />
                     </node>
                    
                     <join name="join1">
                     <transition name="to state-6" to="state-6" />
                     </join>
                    
                     <task-node name="state-6">
                     <task swimlane="user3">
                     <controller>
                     <variable name="initiatorname" access="read"/>
                     <variable name="state-2-yourname" access="read"/>
                     <variable name="state-4-yourname" access="read"/>
                     <variable name="state-5-yourname"/>
                     </controller>
                     </task>
                     <transition to="end" />
                     </task-node>
                    
                     <end-state name="end" />
                    
                    </process-definition>
                    


                    Console Output

                    .......
                    17:03:36,895 INFO [STDOUT] 12211 -> One process started executing
                    17:03:36,895 INFO [STDOUT] 12212
                    17:03:36,895 INFO [STDOUT] 12213
                    17:03:36,895 INFO [STDOUT] 12225
                    17:03:36,895 INFO [STDOUT] 12226
                    17:03:36,895 INFO [STDOUT] 12227
                    17:03:36,895 INFO [STDOUT] 12228
                    17:03:36,895 INFO [STDOUT] 12229
                    17:03:36,895 INFO [STDOUT] 12230
                    17:03:36,895 INFO [STDOUT] 12231
                    17:03:36,895 INFO [STDOUT] 12232
                    17:03:36,973 INFO [STDOUT] 36217 -> Another process running parallely
                    17:03:36,973 INFO [STDOUT] 36218
                    17:03:36,973 INFO [STDOUT] 36219
                    17:03:36,973 INFO [STDOUT] 36220
                    17:03:36,973 INFO [STDOUT] 36221
                    17:03:36,973 INFO [STDOUT] 36222

                    (2 process running parallely running........)

                    17:03:48,020 INFO [STDOUT] 36393
                    17:03:48,020 INFO [STDOUT] 36394
                    17:03:48,098 DEBUG [SchedulerThread] found timer timer(Timer1,17:03:35,000) ->Schedular also running
                    17:03:48,098 DEBUG [SchedulerThread] executing timer 'timer(Timer1,17:03:35,000)'
                    17:03:48,098 INFO [STDOUT] Hibernate: select events0_.TASK_ as TASK8___, events0_.ID_ as ID1___, events0_.EVENTTYPE_ as EVENTTYPE2___, events0_.ID_ as ID1_0_, events0_.EVENTTYPE_ as EVENTTYPE2_7_0_, events0_.TYPE_ as TYPE3_7_0_, events0_.GRAPHELEMENT_ as GRAPHELE4_7_0_ from JBPM_EVENT events0_ where events0_.TASK_=?
                    17:03:48,098 INFO [STDOUT] 36395
                    17:03:48,098 INFO [STDOUT] 36396
                    17:03:48,098 INFO [STDOUT] 36397

                    (2 process running parallely running........)

                    17:03:48,098 INFO [STDOUT] 12456
                    17:03:48,098 INFO [STDOUT] 12457
                    17:03:48,098 INFO [STDOUT] 12458
                    17:03:48,098 INFO [STDOUT] 12459
                    17:03:48,098 INFO [STDOUT] Hibernate: select runtimeact0_.PROCESSINSTANCE_ as PROCESSI5___, runtimeact0_.ID_ as ID1___, runtimeact0_.PROCESSINSTANCEINDEX_ as PROCESSI7___, runtimeact0_.ID_ as ID1_11_, runtimeact0_.EVENTTYPE_ as EVENTTYPE2_22_11_, runtimeact0_.TYPE_ as TYPE3_22_11_, runtimeact0_.GRAPHELEMENT_ as GRAPHELE4_22_11_, runtimeact0_.PROCESSINSTANCE_ as PROCESSI5_22_11_, runtimeact0_.ACTION_ as ACTION6_22_11_, action1_.ID_ as ID1_0_, action1_.NAME_ as NAME3_8_0_, action1_.ISPROPAGATIONALLOWED_ as ISPROPAG4_8_0_, action1_.REFERENCEDACTION_ as REFERENC5_8_0_, action1_.ACTIONDELEGATION_ as ACTIONDE6_8_0_, action1_.EVENT_ as EVENT7_8_0_, action1_.PROCESSDEFINITION_ as PROCESSD8_8_0_, action1_.EXPRESSION_ as EXPRESSION9_8_0_, action1_.TIMERNAME_ as TIMERNAME10_8_0_, action1_.DUEDATE_ as DUEDATE11_8_0_, action1_.REPEAT_ as REPEAT12_8_0_, action1_.TRANSITIONNAME_ as TRANSIT13_8_0_, action1_.TIMERACTION_ as TIMERAC14_8_0_, action1_.class as class0_, action2_.ID_ as ID1_1_, action2_.NA
                    ME_ as NAME3_8_1_, action2_.ISPROPAGATIONALLOWED_ as ISPROPAG4_8_1_, action2_.REFERENCEDACTION_ as REFERENC5_8_1_, action2_.ACTIONDELEGATION_ as ACTIONDE6_8_1_, action2_.EVENT_ as EVENT7_8_1_, action2_.PROCESSDEFINITION_ as PROCESSD8_8_1_, action2_.EXPRESSION_ as EXPRESSION9_8_1_, action2_.TIMERNAME_ as TIMERNAME10_8_1_, action2_.DUEDATE_ as DUEDATE11_8_1_, action2_.REPEAT_ as REPEAT12_8_1_, action2_.TRANSITIONNAME_ as TRANSIT13_8_1_, action2_.TIMERACTION_ as TIMERAC14_8_1_, action2_.class as class1_, delegation3_.ID_ as ID1_2_, delegation3_.CLASSNAME_ as CLASSNAME2_10_2_, delegation3_.CONFIGURATION_ as CONFIGUR3_10_2_, delegation3_.CONFIGTYPE_ as CONFIGTYPE4_10_2_, delegation3_.PROCESSDEFINITION_ as PROCESSD5_10_2_, processdef4_.ID_ as ID1_3_, processdef4_.NAME_ as NAME2_4_3_, processdef4_.VERSION_ as VERSION3_4_3_, processdef4_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_3_, processdef4_.STARTSTATE_ as STARTSTATE5_4_3_, startstate5_.ID_ as ID1_4_, startstate5_.NAME_ as NAME3_5_4_, startsta
                    te5_.PROCESSDEFINITION_ as PROCESSD4_5_4_, startstate5_.ACTION_ as ACTION5_5_4_, startstate5_.SUPERSTATE_ as SUPERSTATE6_5_4_, processdef6_.ID_ as ID1_5_, processdef6_.NAME_ as NAME2_4_5_, processdef6_.VERSION_ as VERSION3_4_5_, processdef6_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_5_, processdef6_.STARTSTATE_ as STARTSTATE5_4_5_, action7_.ID_ as ID1_6_, action7_.NAME_ as NAME3_8_6_, action7_.ISPROPAGATIONALLOWED_ as ISPROPAG4_8_6_, action7_.REFERENCEDACTION_ as REFERENC5_8_6_, action7_.ACTIONDELEGATION_ as ACTIONDE6_8_6_, action7_.EVENT_ as EVENT7_8_6_, action7_.PROCESSDEFINITION_ as PROCESSD8_8_6_, action7_.EXPRESSION_ as EXPRESSION9_8_6_, action7_.TIMERNAME_ as TIMERNAME10_8_6_, action7_.DUEDATE_ as DUEDATE11_8_6_, action7_.REPEAT_ as REPEAT12_8_6_, action7_.TRANSITIONNAME_ as TRANSIT13_8_6_, action7_.TIMERACTION_ as TIMERAC14_8_6_, action7_.class as class6_, event8_.ID_ as ID1_7_, event8_.EVENTTYPE_ as EVENTTYPE2_7_7_, event8_.TYPE_ as TYPE3_7_7_, event8_.GRAPHELEMENT_ as GRAPHELE4_7_
                    7_, processdef9_.ID_ as ID1_8_, processdef9_.NAME_ as NAME2_4_8_, processdef9_.VERSION_ as VERSION3_4_8_, processdef9_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_8_, processdef9_.STARTSTATE_ as STARTSTATE5_4_8_, action10_.ID_ as ID1_9_, action10_.NAME_ as NAME3_8_9_, action10_.ISPROPAGATIONALLOWED_ as ISPROPAG4_8_9_, action10_.REFERENCEDACTION_ as REFERENC5_8_9_, action10_.ACTIONDELEGATION_ as ACTIONDE6_8_9_, action10_.EVENT_ as EVENT7_8_9_, action10_.PROCESSDEFINITION_ as PROCESSD8_8_9_, action10_.EXPRESSION_ as EXPRESSION9_8_9_, action10_.TIMERNAME_ as TIMERNAME10_8_9_, action10_.DUEDATE_ as DUEDATE11_8_9_, action10_.REPEAT_ as REPEAT12_8_9_, action10_.TRANSITIONNAME_ as TRANSIT13_8_9_, action10_.TIMERACTION_ as TIMERAC14_8_9_, action10_.class as class9_, superstate11_.ID_ as ID1_10_, superstate11_.NAME_ as NAME3_5_10_, superstate11_.PROCESSDEFINITION_ as PROCESSD4_5_10_, superstate11_.ACTION_ as ACTION5_5_10_, superstate11_.SUPERSTATE_ as SUPERSTATE6_5_10_ from JBPM_RUNTIMEACTION runtime
                    act0_, JBPM_ACTION action1_, JBPM_ACTION action2_, JBPM_DELEGATION delegation3_, JBPM_PROCESSDEFINITION processdef4_, JBPM_NODE startstate5_, JBPM_PROCESSDEFINITION processdef6_, JBPM_ACTION action7_, JBPM_EVENT event8_, JBPM_PROCESSDEFINITION processdef9_, JBPM_ACTION action10_, JBPM_NODE superstate11_ where runtimeact0_.ACTION_=action1_.ID_(+) and action1_.REFERENCEDACTION_=action2_.ID_(+) and action2_.ACTIONDELEGATION_=delegation3_.ID_(+) and delegation3_.PROCESSDEFINITION_=processdef4_.ID_(+) and processdef4_.STARTSTATE_=startstate5_.ID_(+) and startstate5_.PROCESSDEFINITION_=processdef6_.ID_(+) and startstate5_.ACTION_=action7_.ID_(+) and action7_.EVENT_=event8_.ID_(+) and action7_.PROCESSDEFINITION_=processdef9_.ID_(+) and action7_.TIMERACTION_=action10_.ID_(+) and startstate5_.SUPERSTATE_=superstate11_.ID_(+) and runtimeact0_.PROCESSINSTANCE_=?

                    (2 process running parallely running........)


                    17:04:52,333 INFO [STDOUT] 38384
                    17:04:52,333 INFO [STDOUT] Hibernate: select events0_.NODE_ as NODE6___, events0_.ID_ as ID1___, events0_.EVENTTYPE_ as EVENTTYPE2___, events0_.ID_ as ID1_0_, events0_.EVENTTYPE_ as EVENTTYPE2_7_0_, events0_.TYPE_ as TYPE3_7_0_, events0_.GRAPHELEMENT_ as GRAPHELE4_7_0_ from JBPM_EVENT events0_ where events0_.NODE_=?
                    17:04:52,333 INFO [STDOUT] 14415
                    17:04:52,333 INFO [STDOUT] 14416

                    (2 process running parallely running........)

                    17:04:52,411 INFO [STDOUT] 14430
                    17:04:52,411 INFO [STDOUT] 14431
                    17:04:52,411 INFO [STDOUT] Hibernate: select events0_.PROCESSDEFINITION_ as PROCESSD5___, events0_.ID_ as ID1___, events0_.EVENTTYPE_ as EVENTTYPE2___, events0_.ID_ as ID1_0_, events0_.EVENTTYPE_ as EVENTTYPE2_7_0_, events0_.TYPE_ as TYPE3_7_0_, events0_.GRAPHELEMENT_ as GRAPHELE4_7_0_ from JBPM_EVENT events0_ where events0_.PROCESSDEFINITION_=?
                    17:04:52,411 INFO [STDOUT] 38385
                    17:04:52,411 INFO [STDOUT] 38386

                    (2 process running parallely running........)

                    17:04:52,599 INFO [STDOUT] 38397
                    17:04:52,599 INFO [STDOUT] 14432
                    17:04:52,599 INFO [STDOUT] Hibernate: select leavingtra0_.FROM_ as FROM4___, leavingtra0_.ID_ as ID1___, leavingtra0_.FROMINDEX_ as FROMINDEX6___, leavingtra0_.ID_ as ID1_14_, leavingtra0_.NAME_ as NAME2_6_14_, leavingtra0_.PROCESSDEFINITION_ as PROCESSD3_6_14_, leavingtra0_.FROM_ as FROM4_6_14_, leavingtra0_.TO_ as TO5_6_14_, processdef1_.ID_ as ID1_0_, processdef1_.NAME_ as NAME2_4_0_, processdef1_.VERSION_ as VERSION3_4_0_, processdef1_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_0_, processdef1_.STARTSTATE_ as STARTSTATE5_4_0_, startstate2_.ID_ as ID1_1_, startstate2_.NAME_ as NAME3_5_1_, startstate2_.PROCESSDEFINITION_ as PROCESSD4_5_1_, startstate2_.ACTION_ as ACTION5_5_1_, startstate2_.SUPERSTATE_ as SUPERSTATE6_5_1_, processdef3_.ID_ as ID1_2_, processdef3_.NAME_ as NAME2_4_2_, processdef3_.VERSION_ as VERSION3_4_2_, processdef3_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_2_, processdef3_.STARTSTATE_ as STARTSTATE5_4_2_, action4_.ID_ as ID1_3_, action4_.NAME_ as NAME3_8_3_, action4_.ISPR
                    OPAGATIONALLOWED_ as ISPROPAG4_8_3_, action4_.REFERENCEDACTION_ as REFERENC5_8_3_, action4_.ACTIONDELEGATION_ as ACTIONDE6_8_3_, action4_.EVENT_ as EVENT7_8_3_, action4_.PROCESSDEFINITION_ as PROCESSD8_8_3_, action4_.EXPRESSION_ as EXPRESSION9_8_3_, action4_.TIMERNAME_ as TIMERNAME10_8_3_, action4_.DUEDATE_ as DUEDATE11_8_3_, action4_.REPEAT_ as REPEAT12_8_3_, action4_.TRANSITIONNAME_ as TRANSIT13_8_3_, action4_.TIMERACTION_ as TIMERAC14_8_3_, action4_.class as class3_, action5_.ID_ as ID1_4_, action5_.NAME_ as NAME3_8_4_, action5_.ISPROPAGATIONALLOWED_ as ISPROPAG4_8_4_, action5_.REFERENCEDACTION_ as REFERENC5_8_4_, action5_.ACTIONDELEGATION_ as ACTIONDE6_8_4_, action5_.EVENT_ as EVENT7_8_4_, action5_.PROCESSDEFINITION_ as PROCESSD8_8_4_, action5_.EXPRESSION_ as EXPRESSION9_8_4_, action5_.TIMERNAME_ as TIMERNAME10_8_4_, action5_.DUEDATE_ as DUEDATE11_8_4_, action5_.REPEAT_ as REPEAT12_8_4_, action5_.TRANSITIONNAME_ as TRANSIT13_8_4_, action5_.TIMERACTION_ as TIMERAC14_8_4_, action5_.c
                    lass as class4_, delegation6_.ID_ as ID1_5_, delegation6_.CLASSNAME_ as CLASSNAME2_10_5_, delegation6_.CONFIGURATION_ as CONFIGUR3_10_5_, delegation6_.CONFIGTYPE_ as CONFIGTYPE4_10_5_, delegation6_.PROCESSDEFINITION_ as PROCESSD5_10_5_, processdef7_.ID_ as ID1_6_, processdef7_.NAME_ as NAME2_4_6_, processdef7_.VERSION_ as VERSION3_4_6_, processdef7_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_6_, processdef7_.STARTSTATE_ as STARTSTATE5_4_6_, event8_.ID_ as ID1_7_, event8_.EVENTTYPE_ as EVENTTYPE2_7_7_, event8_.TYPE_ as TYPE3_7_7_, event8_.GRAPHELEMENT_ as GRAPHELE4_7_7_, processdef9_.ID_ as ID1_8_, processdef9_.NAME_ as NAME2_4_8_, processdef9_.VERSION_ as VERSION3_4_8_, processdef9_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_8_, processdef9_.STARTSTATE_ as STARTSTATE5_4_8_, action10_.ID_ as ID1_9_, action10_.NAME_ as NAME3_8_9_, action10_.ISPROPAGATIONALLOWED_ as ISPROPAG4_8_9_, action10_.REFERENCEDACTION_ as REFERENC5_8_9_, action10_.ACTIONDELEGATION_ as ACTIONDE6_8_9_, action10_.EVENT_ as EVEN
                    T7_8_9_, action10_.PROCESSDEFINITION_ as PROCESSD8_8_9_, action10_.EXPRESSION_ as EXPRESSION9_8_9_, action10_.TIMERNAME_ as TIMERNAME10_8_9_, action10_.DUEDATE_ as DUEDATE11_8_9_, action10_.REPEAT_ as REPEAT12_8_9_, action10_.TRANSITIONNAME_ as TRANSIT13_8_9_, action10_.TIMERACTION_ as TIMERAC14_8_9_, action10_.class as class9_, superstate11_.ID_ as ID1_10_, superstate11_.NAME_ as NAME3_5_10_, superstate11_.PROCESSDEFINITION_ as PROCESSD4_5_10_, superstate11_.ACTION_ as ACTION5_5_10_, superstate11_.SUPERSTATE_ as SUPERSTATE6_5_10_, node12_.ID_ as ID1_11_, node12_.NAME_ as NAME3_5_11_, node12_.PROCESSDEFINITION_ as PROCESSD4_5_11_, node12_.ACTION_ as ACTION5_5_11_, node12_.SUPERSTATE_ as SUPERSTATE6_5_11_, node12_.SUBPROCESSDEFINITION_ as SUBPROCE7_5_11_, node12_.DECISIONDELEGATION as DECISION8_5_11_, node12_.SIGNAL_ as SIGNAL9_5_11_, node12_.CREATETASKS_ as CREATET10_5_11_, node12_.CLASS_ as CLASS2_11_, processdef13_.ID_ as ID1_12_, processdef13_.NAME_ as NAME2_4_12_, processdef13_.VER
                    SION_ as VERSION3_4_12_, processdef13_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_12_, processdef13_.STARTSTATE_ as STARTSTATE5_4_12_, delegation14_.ID_ as ID1_13_, delegation14_.CLASSNAME_ as CLASSNAME2_10_13_, delegation14_.CONFIGURATION_ as CONFIGUR3_10_13_, delegation14_.CONFIGTYPE_ as CONFIGTYPE4_10_13_, delegation14_.PROCESSDEFINITION_ as PROCESSD5_10_13_ from JBPM_TRANSITION leavingtra0_, JBPM_PROCESSDEFINITION processdef1_, JBPM_NODE startstate2_, JBPM_PROCESSDEFINITION processdef3_, JBPM_ACTION action4_, JBPM_ACTION action5_, JBPM_DELEGATION delegation6_, JBPM_PROCESSDEFINITION processdef7_, JBPM_EVENT event8_, JBPM_PROCESSDEFINITION processdef9_, JBPM_ACTION action10_, JBPM_NODE superstate11_, JBPM_NODE node12_, JBPM_PROCESSDEFINITION processdef13_, JBPM_DELEGATION delegation14_ where leavingtra0_.PROCESSDEFINITION_=processdef1_.ID_(+) and processdef1_.STARTSTATE_=startstate2_.ID_(+) and startstate2_.PROCESSDEFINITION_=processdef3_.ID_(+) and startstate2_.ACTION_=action4_.ID_(+) a
                    nd action4_.REFERENCEDACTION_=action5_.ID_(+) and action5_.ACTIONDELEGATION_=delegation6_.ID_(+) and delegation6_.PROCESSDEFINITION_=processdef7_.ID_(+) and action5_.EVENT_=event8_.ID_(+) and action5_.PROCESSDEFINITION_=processdef9_.ID_(+) and action5_.TIMERACTION_=action10_.ID_(+) and startstate2_.SUPERSTATE_=superstate11_.ID_(+) and leavingtra0_.TO_=node12_.ID_(+) and node12_.SUBPROCESSDEFINITION_=processdef13_.ID_(+) and node12_.DECISIONDELEGATION=delegation14_.ID_(+) and leavingtra0_.FROM_=?

                    (2 process running parallely running........)

                    17:06:53,710 DEBUG [SchedulerThread] checking for timers
                    17:06:53,710 INFO [STDOUT] 19050
                    17:06:53,710 INFO [STDOUT] 19051
                    17:06:53,710 INFO [STDOUT] 19052
                    17:06:53,710 INFO [STDOUT] 19053
                    17:06:53,710 INFO [STDOUT] 19054

                    (.........)

                    17:06:53,710 INFO [STDOUT] Hibernate: select timer0_.ID_ as col_0_0_ from JBPM_TIMER timer0_ where timer0_.EXCEPTION_ is null order by timer0_.DUEDATE_ asc

                    (.........)

                    17:07:27,507 INFO [STDOUT] 42068
                    17:07:27,507 DEBUG [GraphElement] event 'node-enter' on 'Join(join1)' for 'Token(/aH+state-4)'
                    17:07:27,507 INFO [STDOUT] Hibernate: select events0_.NODE_ as NODE6___, events0_.ID_ as ID1___, events0_.EVENTTYPE_ as EVENTTYPE2___, events0_.ID_ as ID1_0_, events0_.EVENTTYPE_ as EVENTTYPE2_7_0_, events0_.TYPE_ as TYPE3_7_0_, events0_.GRAPHELEMENT_ as GRAPHELE4_7_0_ from JBPM_EVENT events0_ where events0_.NODE_=?
                    17:07:27,507 INFO [STDOUT] 42069
                    17:07:27,507 INFO [STDOUT] 42070

                    (.........)

                    17:07:27,507 INFO [STDOUT] Hibernate: select children0_.PARENT_ as PARENT11___, children0_.ID_ as ID1___, children0_.NAME_ as NAME2___, children0_.ID_ as ID1_17_, children0_.NAME_ as NAME2_21_17_, children0_.START_ as START3_21_17_, children0_.END_ as END4_21_17_, children0_.NODEENTER_ as NODEENTER5_21_17_, children0_.NEXTLOGINDEX_ as NEXTLOGI6_21_17_, children0_.ISABLETOREACTIVATEPARENT_ as ISABLETO7_21_17_, children0_.ISTERMINATIONIMPLIC
                    NAME2_4_1_, processdef2_.VERSION_ as VERSION3_4_1_, processdef2_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_1_, processdef2_.STARTSTATE_ as STARTSTATE5_4_1_, startstate3_.ID_ as ID1_2_, startstate3_.NAME_ as NAME3_5_2_, startstate3_.PROCESSDEFINITION_ as PROCESSD4_5_2_, startstate3_.ACTION_ as ACTION5_5_2_, startstate3_.SUPERSTATE_ as SUPERSTATE6_5_2_, action4_.ID_ as ID1_3_, action4_.NAME_ as NAME3_8_3_, action4_.ISPROPAGATIONALLOWED_ as ISPROP
                    on5_.REFERENCEDACTION_ as REFERENC5_8_4_, action5_.ACTIONDELEGATION_ as ACTIONDE6_8_4_, action5_.EVENT_ as EVENT7_8_4_, action5_.PROCESSDEFINITION_ as PROCESSD8_8_4_, action5_.EXPRESSION_ as EXPRESSION9_8_4_, action5_.TIMERNAME_ as TIMERNAME10_8_4_, action5_.DUEDATE_ as DUEDATE11_8_4_, action5_.REPEAT_ as REPEAT12_8_4_, action5_.TRANSITIONNAME_ as TRANSIT13_8_4_, action5_.TIMERACTION_ as TIMERAC14_8_4_, action5_.class as class4_, delegation
                    _.ID_ as ID1_8_, processdef9_.NAME_ as NAME2_4_8_, processdef9_.VERSION_ as VERSION3_4_8_, processdef9_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_8_, processdef9_.STARTSTATE_ as STARTSTATE5_4_8_, action10_.ID_ as ID1_9_, action10_.NAME_ as NAME3_8_9_, action10_.ISPROPAGATIONALLOWED_ as ISPROPAG4_8_9_, action10_.REFERENCEDACTION_ as REFERENC5_8_9_, action10_.ACTIONDELEGATION_ as ACTIONDE6_8_9_, action10_.EVENT_ as EVENT7_8_9_, action10_.PROCESSD
                    AME_ as NAME2_4_11_, processdef12_.VERSION_ as VERSION3_4_11_, processdef12_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_11_, processdef12_.STARTSTATE_ as STARTSTATE5_4_11_, delegation13_.ID_ as ID1_12_, delegation13_.CLASSNAME_ as CLASSNAME2_10_12_, delegation13_.CONFIGURATION_ as CONFIGUR3_10_12_, delegation13_.CONFIGTYPE_ as CONFIGTYPE4_10_12_, delegation13_.PROCESSDEFINITION_ as PROCESSD5_10_12_, processins14_.ID_ as ID1_13_, processins14_.ST
                    NODEENTER_ as NODEENTER5_21_15_, token16_.NEXTLOGINDEX_ as NEXTLOGI6_21_15_, token16_.ISABLETOREACTIVATEPARENT_ as ISABLETO7_21_15_, token16_.ISTERMINATIONIMPLICIT_ as ISTERMIN8_21_15_, token16_.NODE_ as NODE9_21_15_, token16_.PROCESSINSTANCE_ as PROCESS10_21_15_, token16_.PARENT_ as PARENT11_21_15_, token17_.ID_ as ID1_16_, token17_.NAME_ as NAME2_21_16_, token17_.START_ as START3_21_16_, token17_.END_ as END4_21_16_, token17_.NODEENTER_ a
                    sdef9_, JBPM_ACTION action10_, JBPM_NODE superstate11_, JBPM_PROCESSDEFINITION processdef12_, JBPM_DELEGATION delegation13_, JBPM_PROCESSINSTANCE processins14_, JBPM_PROCESSDEFINITION processdef15_, JBPM_TOKEN token16_, JBPM_TOKEN token17_ where children0_.NODE_=node1_.ID_(+) and node1_.PROCESSDEFINITION_=processdef2_.ID_(+) and processdef2_.STARTSTATE_=startstate3_.ID_(+) and startstate3_.ACTION_=action4_.ID_(+) and action4_.REFERENCEDACTI
                    n16_.ID_(+) and processins14_.SUPERPROCESSTOKEN_=token17_.ID_(+) and children0_.PARENT_=?
                    17:07:27,507 INFO [STDOUT] 42135
                    17:07:27,507 INFO [STDOUT] 42136
                    17:07:27,507 INFO [STDOUT] 42137

                    (.........)

                    17:07:27,538 DEBUG [Join] join will not yet reactivate parent: found concurrent token 'Token(/aH+state-2)'
                    17:07:27,538 DEBUG [GraphElement] event 'after-signal' on 'TaskNode(state-4)' for 'Token(/aH+state-4)'
                    17:07:27,538 DEBUG [TaskBean] assignmentlogs: []
                    17:07:27,538 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
                    17:07:27,538 INFO [STDOUT] 42602
                    17:07:27,538 INFO [STDOUT] 42603

                    (run run run .............)

                    17:09:18,977 INFO [STDOUT] 65536
                    17:09:18,977 INFO [STDOUT] Ending Reading File
                    17:09:18,977 INFO [STDOUT] Leaving to next default transition
                    17:09:18,977 INFO [STDOUT] Hibernate: select leavingtra0_.FROM_ as FROM4___, leavingtra0_.ID_ as ID1___, leavingtra0_.FROMINDEX_ as FROMINDEX6___, leavingtra0_.ID_ as ID1_14_, leavingtra0_.NAME_ as NAME2_6_14_, leavingtra0_.PROCESSDEFINITION_ as PROCESSD3_6_14_, leavingtra0_.FROM_ as FROM4_6_14_, leavingtra0_.TO_ as TO5_6_14_, processdef1_.ID_ as ID1_0_, processdef1_.NAME_ as NAME2_4_0_, processdef1_.VERSION_ as VERSION3_4_0_, processdef1_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_0_, processdef1_.STARTSTATE_ as STARTSTATE5_4_0_, startstate2_.ID_ as ID1_1_, startstate2_.NAME_ as NAME3_5_1_, startstate2_.PROCESSDEFINITION_ as PROCESSD4_5_1_, startstate2_.ACTION_ as ACTION5_5_1_, startstate2_.SUPERSTATE_ as SUPERSTATE6_5_1_, processdef3_.ID_ as ID1_2_, processdef3_.NAME_ as NAME2_4_2_, processdef3_.VERSION_ as VERSION3_4_2_, processdef3_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_2_, processdef3_.STARTSTATE_ as STARTSTATE5_4_2_, action4_.ID_ as ID1_3_, action4_.NAME_ as NAME3_8_3_, action4_.ISPR
                    OPAGATIONALLOWED_ as ISPROPAG4_8_3_, action4_.REFERENCEDACTION_ as REFERENC5_8_3_, action4_.ACTIONDELEGATION_ as ACTIONDE6_8_3_, action4_.EVENT_ as EVENT7_8_3_, action4_.PROCESSDEFINITION_ as PROCESSD8_8_3_, action4_.EXPRESSION_ as EXPRESSION9_8_3_, action4_.TIMERNAME_ as TIMERNAME10_8_3_, action4_.DUEDATE_ as DUEDATE11_8_3_, action4_.REPEAT_ as REPEAT12_8_3_, action4_.TRANSITIONNAME_ as TRANSIT13_8_3_, action4_.TIMERACTION_ as TIMERAC14_8_3_, action4_.class as class3_, action5_.ID_ as ID1_4_, action5_.NAME_ as NAME3_8_4_, action5_.ISPROPAGATIONALLOWED_ as ISPROPAG4_8_4_, action5_.REFERENCEDACTION_ as REFERENC5_8_4_, action5_.ACTIONDELEGATION_ as ACTIONDE6_8_4_, action5_.EVENT_ as EVENT7_8_4_, action5_.PROCESSDEFINITION_ as PROCESSD8_8_4_, action5_.EXPRESSION_ as EXPRESSION9_8_4_, action5_.TIMERNAME_ as TIMERNAME10_8_4_, action5_.DUEDATE_ as DUEDATE11_8_4_, action5_.REPEAT_ as REPEAT12_8_4_, action5_.TRANSITIONNAME_ as TRANSIT13_8_4_, action5_.TIMERACTION_ as TIMERAC14_8_4_, action5_.c
                    lass as class4_, delegation6_.ID_ as ID1_5_, delegation6_.CLASSNAME_ as CLASSNAME2_10_5_, delegation6_.CONFIGURATION_ as CONFIGUR3_10_5_, delegation6_.CONFIGTYPE_ as CONFIGTYPE4_10_5_, delegation6_.PROCESSDEFINITION_ as PROCESSD5_10_5_, processdef7_.ID_ as ID1_6_, processdef7_.NAME_ as NAME2_4_6_, processdef7_.VERSION_ as VERSION3_4_6_, processdef7_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_6_, processdef7_.STARTSTATE_ as STARTSTATE5_4_6_, event8_.ID_ as ID1_7_, event8_.EVENTTYPE_ as EVENTTYPE2_7_7_, event8_.TYPE_ as TYPE3_7_7_, event8_.GRAPHELEMENT_ as GRAPHELE4_7_7_, processdef9_.ID_ as ID1_8_, processdef9_.NAME_ as NAME2_4_8_, processdef9_.VERSION_ as VERSION3_4_8_, processdef9_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_8_, processdef9_.STARTSTATE_ as STARTSTATE5_4_8_, action10_.ID_ as ID1_9_, action10_.NAME_ as NAME3_8_9_, action10_.ISPROPAGATIONALLOWED_ as ISPROPAG4_8_9_, action10_.REFERENCEDACTION_ as REFERENC5_8_9_, action10_.ACTIONDELEGATION_ as ACTIONDE6_8_9_, action10_.EVENT_ as EVEN
                    T7_8_9_, action10_.PROCESSDEFINITION_ as PROCESSD8_8_9_, action10_.EXPRESSION_ as EXPRESSION9_8_9_, action10_.TIMERNAME_ as TIMERNAME10_8_9_, action10_.DUEDATE_ as DUEDATE11_8_9_, action10_.REPEAT_ as REPEAT12_8_9_, action10_.TRANSITIONNAME_ as TRANSIT13_8_9_, action10_.TIMERACTION_ as TIMERAC14_8_9_, action10_.class as class9_, superstate11_.ID_ as ID1_10_, superstate11_.NAME_ as NAME3_5_10_, superstate11_.PROCESSDEFINITION_ as PROCESSD4_5_10_, superstate11_.ACTION_ as ACTION5_5_10_, superstate11_.SUPERSTATE_ as SUPERSTATE6_5_10_, node12_.ID_ as ID1_11_, node12_.NAME_ as NAME3_5_11_, node12_.PROCESSDEFINITION_ as PROCESSD4_5_11_, node12_.ACTION_ as ACTION5_5_11_, node12_.SUPERSTATE_ as SUPERSTATE6_5_11_, node12_.SUBPROCESSDEFINITION_ as SUBPROCE7_5_11_, node12_.DECISIONDELEGATION as DECISION8_5_11_, node12_.SIGNAL_ as SIGNAL9_5_11_, node12_.CREATETASKS_ as CREATET10_5_11_, node12_.CLASS_ as CLASS2_11_, processdef13_.ID_ as ID1_12_, processdef13_.NAME_ as NAME2_4_12_, processdef13_.VER
                    SION_ as VERSION3_4_12_, processdef13_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_12_, processdef13_.STARTSTATE_ as STARTSTATE5_4_12_, delegation14_.ID_ as ID1_13_, delegation14_.CLASSNAME_ as CLASSNAME2_10_13_, delegation14_.CONFIGURATION_ as CONFIGUR3_10_13_, delegation14_.CONFIGTYPE_ as CONFIGTYPE4_10_13_, delegation14_.PROCESSDEFINITION_ as PROCESSD5_10_13_ from JBPM_TRANSITION leavingtra0_, JBPM_PROCESSDEFINITION processdef1_, JBPM_NODE startstate2_, JBPM_PROCESSDEFINITION processdef3_, JBPM_ACTION action4_, JBPM_ACTION action5_, JBPM_DELEGATION delegation6_, JBPM_PROCESSDEFINITION processdef7_, JBPM_EVENT event8_, JBPM_PROCESSDEFINITION processdef9_, JBPM_ACTION action10_, JBPM_NODE superstate11_, JBPM_NODE node12_, JBPM_PROCESSDEFINITION processdef13_, JBPM_DELEGATION delegation14_ where leavingtra0_.PROCESSDEFINITION_=processdef1_.ID_(+) and processdef1_.STARTSTATE_=startstate2_.ID_(+) and startstate2_.PROCESSDEFINITION_=processdef3_.ID_(+) and startstate2_.ACTION_=action4_.ID_(+) a
                    nd action4_.REFERENCEDACTION_=action5_.ID_(+) and action5_.ACTIONDELEGATION_=delegation6_.ID_(+) and delegation6_.PROCESSDEFINITION_=processdef7_.ID_(+) and action5_.EVENT_=event8_.ID_(+) and action5_.PROCESSDEFINITION_=processdef9_.ID_(+) and action5_.TIMERACTION_=action10_.ID_(+) and startstate2_.SUPERSTATE_=superstate11_.ID_(+) and leavingtra0_.TO_=node12_.ID_(+) and node12_.SUBPROCESSDEFINITION_=processdef13_.ID_(+) and node12_.DECISIONDELEGATION=delegation14_.ID_(+) and leavingtra0_.FROM_=?
                    17:09:18,993 INFO [STDOUT] Hibernate: select events0_.NODE_ as NODE6___, events0_.ID_ as ID1___, events0_.EVENTTYPE_ as EVENTTYPE2___, events0_.ID_ as ID1_0_, events0_.EVENTTYPE_ as EVENTTYPE2_7_0_, events0_.TYPE_ as TYPE3_7_0_, events0_.GRAPHELEMENT_ as GRAPHELE4_7_0_ from JBPM_EVENT events0_ where events0_.NODE_=?
                    17:09:18,993 INFO [STDOUT] Hibernate: select events0_.PROCESSDEFINITION_ as PROCESSD5___, events0_.ID_ as ID1___, events0_.EVENTTYPE_ as EVENTTYPE2___, events0_.ID_ as ID1_0_, events0_.EVENTTYPE_ as EVENTTYPE2_7_0_, events0_.TYPE_ as TYPE3_7_0_, events0_.GRAPHELEMENT_ as GRAPHELE4_7_0_ from JBPM_EVENT events0_ where events0_.PROCESSDEFINITION_=?
                    17:09:18,993 DEBUG [GraphElement] event 'node-leave' on 'Node(state-3)' for 'Token(/aH+state-2)'
                    17:09:18,993 DEBUG [GraphElement] event 'transition' on 'Transition(to join1)' for 'Token(/aH+state-2)'

                    [ ...Finally ended fine. {After join, next task was assigned to 'shailesh'} ]





                    • 22. Re: Simultaneous execution of  Fork children
                      chprvkmr

                      Based on the above experimentation, we tried to introduce timers that can pass control to next transition once it got triggered.

                      It worked fine, but net result was only one process got executed at a time. Eventhough here action logic is not clubbed with any timer's event, Why schedular not triggered another timer?How it's different from previous approach. Please help.

                      Process definition

                      <?xml version="1.0" encoding="UTF-8"?>
                      
                      <process-definition name="egjointest11">
                      
                       <!-- SWIMLANES (= process roles) -->
                       <swimlane name="user1">
                       <assignment expression="user(praveen)" />
                       </swimlane>
                      
                       <swimlane name="user2">
                       <assignment expression="user(siddarth)" />
                       </swimlane>
                      
                       <swimlane name="user3">
                       <assignment expression="user(shaileshraval)" />
                       </swimlane>
                      
                       <swimlane name="user4">
                       <assignment expression="user(rajeev)" />
                       </swimlane>
                      
                       <!-- NODES -->
                      
                       <start-state name="state-1">
                       <task>
                       <controller>
                       <variable name="initiatorname" />
                       <variable name="fileName" />
                       <variable name="pathName" />
                       </controller>
                       </task>
                       <transition to="fork1" />
                       </start-state>
                      
                       <fork name="fork1">
                       <transition name="to state-2" to="state-2" />
                       <transition name="to state-4" to="state-4" />
                       </fork>
                      
                       <task-node name="state-2">
                       <task>
                       <timer name="Timer1" duedate="20 seconds" transition="to state-3" />
                       <controller>
                       <variable name="initiatorname" access="read"/>
                       <variable name="state-2-yourname"/>
                       </controller>
                       </task>
                       <transition name="to state-3" to="state-3" />
                       </task-node>
                      
                       <node name="state-3">
                       <action class="com.tcs.webapp.demo1.ReadFile">
                       <msg>Action node Triggered For Reading File state-3</msg>
                       </action>
                       <transition name="to join1" to="join1" />
                       </node>
                      
                       <task-node name="state-4">
                       <task>
                       <timer name="Timer2" duedate="20 seconds" transition="to state-5" />
                       <controller>
                       <variable name="initiatorname" access="read"/>
                       <variable name="state-4-yourname"/>
                       </controller>
                       </task>
                       <transition name="to state-5" to="state-5" />
                       </task-node>
                      
                       <node name="state-5">
                       <action class="com.tcs.webapp.demo1.ReadFile">
                       <msg>Action node Triggered For Reading File state-5</msg>
                       </action>
                       <transition name="to join1" to="join1" />
                       </node>
                      
                       <join name="join1">
                       <transition name="to state-6" to="state-6" />
                       </join>
                      
                       <task-node name="state-6">
                       <task swimlane="user3">
                       <controller>
                       <variable name="initiatorname" access="read"/>
                       <variable name="state-2-yourname" access="read"/>
                       <variable name="state-4-yourname" access="read"/>
                       <variable name="state-5-yourname"/>
                       </controller>
                       </task>
                       <transition to="end" />
                       </task-node>
                      
                       <end-state name="end" />
                      
                      </process-definition>
                      


                      • 23. Re: Simultaneous execution of  Fork children
                        chprvkmr

                        Hi,

                        Anyone using jbpm 3.0.2 ? Please state how to make children under fork to be executed parallely. I tried in many ways, not succeeded. Its urgent.

                        Also it seems to me that at a time only one timer gets executed. (especially if transition from timer goes to some node, which executes so long) . It seems to me that everything in jbpm is sequential apart from having multiple tokens. Having multiples tokens, which indicates different states [some states may require to run parallely - ;) ] is good but wholeprocess is going in a single thread!?. May be my interpretation is wrong or Iam confused.

                        Please assist me in accomplishing execution of children under fork parallely.

                        • 24. Re: Simultaneous execution of  Fork children
                          ralfoeldi

                          Hi 'chprvkmr',

                          it's actually quite simple.

                          Use JMS to spawn a new Thread. To do that give the Message all the information needed (tokenId, expected nodeId - just to be sure, transition to take), send it to a MDB that triggers the transition. The amount of concurrent Threads depends on the configuration of your MDBs.

                          If you're using the SchedulerThread from jBPM and have a look at the source code, you'll see that everything does happen sequentially and even in a single transaction. See http://www.jboss.com/index.html?module=bb&op=viewtopic&t=73234.

                          If you don't want to use the SchredulerThread you'll probably have to roll your own, i.e. start your own Threads.

                          There is a possible problem with concurrent execution. Depending on what aspects of the processInstance you're changing you could get conflicting concurrent changes in the DB. See http://www.jboss.com/index.html?module=bb&op=viewtopic&t=73332.

                          I'm using jBPM 3.0.2 and it works for me.

                          Freeting

                          Rainer

                          • 25. Re: Simultaneous execution of  Fork children
                            ralfoeldi

                            aaahhh

                            'Greetings', not 'Freeting'

                            Probably has to do with high body temperatur due to a serious case of cold :-(

                            • 26. Re: Simultaneous execution of  Fork children
                              sforema

                              I am also confused by the use of the term "concurrent" with the fork and join. Concurrent means "occurring or operating at the same time", which is not the case here. Having to manually enhance jBPM to get it to run concurrent processes asynchronously seems odd. I would think this would be the default behavior.

                              I understand what it is doing, but it is confusing. The documentation in regards to fork and join should spell this out. It would have saved me 4 hours of scratching my head, trying to figure out what is going on...

                              • 27. Re: Simultaneous execution of  Fork children
                                chprvkmr

                                Hi,

                                Yes ofcourse, not specifying in userguide the meaning of concurrent to fork node is really misleading. I would have not wasted my time. Nevertheless lets hope jbpm will comeup with an alternative approach. As we are not using any EJB stuff (only jsps and servlets), this behaviour of fork will be of big headache to us.

                                I need some clarification to the approach specified by Ralfoeldi, please clarify me if possible.

                                Lets consider a simple process definition with start-state, fork node with two childs, a join and an end-state.

                                After calling/passing a message to JMS, an action to be executed is decided based on parameters passed. ....thats fine. After that I need to signal token to get on to next state (lets say next fork child), right! Until then action that is associated with next fork child is not executed. Am I right.

                                Lets go with an eg., it seems to me to make current fork approach(which is sequential) to parallel is something like splitting a sequential program as follows::


                                step-1
                                step-2
                                step-3
                                ..
                                step-10

                                step-11
                                step-12
                                step-13
                                ..
                                step-20


                                Above steps needs to be splitted in such a manner so that first 10 steps and next 10 steps needs to be run parallely (concurrently)!



                                • 28. Re: Simultaneous execution of  Fork children
                                  koen.aers

                                  Again, don't use jBPM as a thread scheduler. Use it as a BPM engine and all will be fine. What can we do? Should we not use the word 'fork' and 'join' because there could be some confusion? Then you could argue about the word 'process'. For some of us this means a bunch of instructions running on a processor, for others it means a business procedure.
                                  A fork is a notational element in JPDL, borrowed from UML activity diagrams. As in UML activity diagrams it denotes a split in the execution of a (business) process into two or more paths of execution that may happen in parallel. The runtime engine of jBPM creates two child tokens corresponding to these paths of execution. These child tokens can be signalled independently, but of course only if they end up in a wait state somewhere between the fork and the join. If there is no wait state in between then calculation will be deterministic and there will be no real parallelism.

                                  Regards,
                                  Koen

                                  • 29. Re: Simultaneous execution of  Fork children
                                    sforema

                                    As an outsider using jBPM and trying to get it ready for production to run our batch processes, it has been throwing me some curve balls.

                                    Don't get me wrong here, I like jBPM and picked it from a field of other BPM systems (osworkflow, wfmopen, shark, openwfe, etc...)

                                    I do look at stuff with a "simpleton's" view of the world, but it has frustrated me in two areas:

                                    1. I expected it automatically persist state whenever a state chage occurs. Say what you will, but my expectation of BPM software that claims to be persistent should do this for you. I shouldn't have to do anything to make this work. I solved this problem by passing around a transient variable with a sychronized transaction that I commited and rebegan at each step, but I don't feel I should have had to do this.

                                    2. I expected parallel processing with a fork. If you have to put a process into a wait state to cause parallel activity, it doesn't feel right. What if intel released a processor that they said allowed concurrent processing but then said "oh, it really doesn't do this unless your code helps us".

                                    Enough ranting. I will play with it today to figure out a workable solution in a non-managed environment (jetty). I just wish I didn't have to and could work on my process/job management screens instead.

                                    Sean