[jboss-user] [JBoss jBPM] - Concurrency/Async

mmusaji do-not-reply at jboss.com
Wed Aug 19 10:47:07 EDT 2009

I've done quite a bit of searching and reading on asynchronous processes in jbpm, and I'm slightly confused as to whether or not JBPM 4.0 can handle parallel processes? (not parallel business processes).

My unit test calls 3 processes which should be started by the workflow independently of each other. 

  | <java class="org.workflow.FindProviders" g="276,7,80,40" method="execute" name="find providers">
  |      <transition name="" to="fork"/>
  |    </java>
  |    <fork g="298,85,80,40" name="fork">
  |       <transition g="-62,-18" name="validate red" to="validate red request"/>
  |       <transition g="-64,-18" name="validate exp" to="validate exp request"/>
  |       <transition g="-63,-17" name="validate sys" to="validate sys request"/> 
  |    </fork>
  |    <custom continue="async" name="validate red request" class="org.workflow.Validate1" exp="#{myObj}">         
  |     <transition g="-27,-18" name="" to="join"/>
  |    </custom>
  |    <custom continue="async" name="validate exp request" class="org.workflow.Validate2" exp="#{myObj}">         
  |     <transition g="-27,-18" name="" to="join"/>
  |    </custom>
  |    <custom continue="async" name="validate sys request" class="org.workflow.Validate3" exp="#{myObj}">         
  |     <transition g="-27,-18" name="" to="join"/>
  |    </custom>   
  |    <join g="267,368,80,40" name="join">
  |       <transition name="check results" to="evaluate validation results" g="-47,-16"/>
  |    </join>

Within classes Validate1, Validate2, Validate3, I put the thread to sleep for different times (2, 3 and 6 seconds). I expected the maximum time for completion would be 6 seconds.

My Unit test does start each job one after the other which, I am hoping is the reason why this is not working as expected. I'm stuck as to how I would write a Unit test to ensure it is happening in parallel.

  | List<Job> jobs = managementService.createJobQuery()
  |         .processInstanceId(processInstanceId)
  |         .list();
  |  for(Job job: jobs) {
  |             managementService.executeJob(job.getId());  
  |         }

Any suggestions would be much appreciated.


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4250420#4250420

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4250420

More information about the jboss-user mailing list