fork & join not working properly
forjbpm Feb 9, 2006 4:01 PMHi!
I have a process definition like
<?xml version="1.0" encoding="UTF-8"?> <process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="MyDef"> <swimlane name="user"></swimlane> <start-state name="Step1"> <task name="Step1" swimlane="user"> <controller> <variable name="var1"></variable> <variable name="var2"></variable> <variable name="var3"></variable> </controller> </task> <transition name="" to="DocFork"></transition> </start-state> <fork name="DocFork"> <transition name="Step21" to="Step21"> </transition> <transition name="Step22" to="Step22"> </transition> </fork> <task-node name="Step21"> <task name="Step21" swimlane="user"> <controller> <variable name="var1"></variable> <variable name="var2"></variable> <variable name="var3"></variable> </controller> </task> <event type="node-enter"> <action name="action1" class="com.MyDef.step21.class"></action> </event> <transition name="" to="DocJoin"> </transition> </task-node> <task-node name="Step22"> <task name="Step22" swimlane="user"> <controller> <variable name="var1"></variable> <variable name="var2"></variable> <variable name="var3"></variable> </controller></task> <event type="node-enter"> <action name="action1" class ="com.MyDef.step22.class"></action> </event> <transition name="" to="DocJoin"> </transition> </task-node> <join name="DocJoin"> <transition name="" to="step3"></transition> </join> <task-node name="step3"> <task name="step3" swimlane="user"> <controller> <variable name="var1"></variable> <variable name="var2"></variable> <variable name="var3"></variable> </controller> </task> <transition name="" to="End"> </transition> </task-node> <end-state name="End"></end-state> </process-definition>
my com.MyDef.step21 & step 22 action handlers are :
public void execute(ExecutionContext exeContext) throws Exception { // execute external program Process p = Runtime.exec("/home/Myprogram.sh"); // wait for the program to terminate p.waitFor(); // resume the process exeContext.leaveNode(); }
Interestingly when I start new process execution and when it reaches the fork.
I get three instances of the same flow.
one is in step21 state.
second is in step22 state
and third is in step 3 state!!!!
Any comments??
Do I consider it as a bug or I need to change my process diagram. In reality all these steps represent imoprtant steps in our product.
Regards and Thanks in advace!