Subprocess transition in a fork is not working
felixkjose Jun 3, 2010 1:35 PMHi All,
I am having a main JBPM process(helloworld.jpdl.xml) and in that having a fork of that one transition to a sub process and the other to a state node. And these to should transition to a join join1 node. When I started the process it sucessfully reaching the fork and both two transitions are reached. But As the subprocess contains a state node "printHelloWorld" the execution will wait in that. And meanwhile as the other transition node in the fork is a state node (Being1) it also wait in that node.
snippet of Main process(helloworld.jpdl.xml)
<fork g="101,278,80,40" name="printHelloWorld">
<transition g="56,193:-39,-18" name="Being1" to="Being1"/>
<transition g="137,177:24,8" name="review" to="review"/>
</fork>
<join g="855,204,80,40" name="join1">
<transition to="printHelloWorld2"/>
</join>
<state name="Being1" g="0,0,80,40">
<transition to="join1" g="877,666:"/>--------Other execution is active at this node. Waiting for an external signal
</state>
<sub-process name="review" sub-process-key="SubProc" g="0,0,80,40">
<transition to="join1" g="877,666:"/>
</sub-process>
subporcess (SubPoc.jpdl.xml)
<process name="SubProc" xmlns="http://jbpm.org/4.3/jpdl">
<start g="372,19,80,40">
<transition to="printHelloWorld"/>
</start>
<state name="printHelloWorld" g="0,0,80,40">------Subprocess execution is waiting in This node. Waiting for an external signal.
<transition name="printHelloWorld1" to="printHelloWorld1" g="877,666:"/>
</state>
<java g="539,206,138,40" method="printHelloWorld" name="printHelloWorld1">
<transition g="606,516:-39,-18" name="theEnd" to="theEnd"/>
</java>
<end g="369,491,80,40" name="theEnd"/>
</process>
I have used processInstance.getExecutions() which gives the active executions and the result is:
[execution[helloWorld.13.Being1], execution[helloWorld.13.review]]
Then by using openExecutio.getSubProcessInstance().getId(); I find out the subprocess instance id and is [SubProc.21].
Then I signaled the subprocess using executionService.signalExecutionById(id,"printHelloWorld1"); And it sucessfully transitioned and it prints :
<---------------->
HELLO FELIX!
<---------------->
So the subprocess sucessfully completed. But when I check activeactivity name in the subprcess it still shows printHelloWorld state node (by using openExecutio.getSubProcessInstance().findActiveActivityNames()---o/p is --[printHelloWorld])
And also when I checked active executions using processInstance.getExecutions() it still gives:
[execution[helloWorld.13.Being1], execution[helloWorld.13.review]] that means both two forked transitions are in wait state.
So my doubt is how can I transition the subprocess fron one state to another instead of using executionService.signalExecutionById(id,"printHelloWorld1");?
I have attached the sample application with this. Can you please give a solution as soon as possible?
Thank You and Regards,
Felix K Jose
-
JBPM_AND_DROOLS.zip 13.6 MB