[jboss-user] [JBoss jBPM] - How to define a process definition that has multiples sub-pr
faite
do-not-reply at jboss.com
Mon Dec 15 10:06:13 EST 2008
Use Case
- create a process definition that manage new files in the system.
- Read a file that has multiples records.
- create a sub-process to manage each record.
- after all sub-process are created wait until all sub-processes finish.
- report that the file was processed.
I implemented this use case using an action that create the sub-process, but the problem with it is that the parent process don't wait until all processes finish.
Could you give me an idea how to implement this?
Thanks
Next is my process definition and my action code.
process definition
| **********************
| <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="listingloads">
| <start-state name="load new file">
| <transition to="join1">
| <action name="action" class="com.sample.action.listingloads.FileDropsActionHandler">
| </action>
| </transition>
| </start-state>
| <join name="join1">
| <transition to="end"></transition>
| </join>
| <end-state name="end"></end-state>
| </process-definition>
|
| Action(I use this code to create the sub-processes)
| ***************************************************************
| ProcessInstance pi = context.getJbpmContext().newProcessInstance( "process-a-record" );
| context.setSubProcessInstance( pi );
| pi.getContextInstance().setVariable( "message", message );
| pi.getContextInstance().setVariable( "fileName", fileName );
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4196601#4196601
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4196601
More information about the jboss-user
mailing list