[
https://jira.jboss.org/browse/JBPM-2888?page=com.atlassian.jira.plugin.sy...
]
Rajesh Krishnamurthy commented on JBPM-2888:
--------------------------------------------
The same issue has been faced by our team too.
We are trying to use JBPM's fork/join feature to parallely invoke sub-processes and
then join after the sub-process execution and continue executing the main workflow.
Firstly, tried this feature in a sample load test scenario and here are our findings:
|-----> evaluateShipGoodsSubProcess ----->
|
ForkWithSubProcess ----->|
|---------------> end
|-----> evaluateSendBillSubProcess
-----> |
A. JPDLs:
---------------
1. fork-test.jpdl.xml
<process key="ForkWithSubProcess" name="ForkWithSubProcess"
version="1"
xmlns="http://jbpm.org/4.3/jpdl" >
<start>
<transition to="beforeFork"/>
</start>
<java continue="async"
class="com.yahoo.ionix.workflow.forktest.TestHelper"
method="beforeFork" name="beforeFork">
<transition to="fork1"/>
</java>
<fork name="fork1">
<on event="end" continue="exclusive"/>
<transition to="evaluateShipGoodsSubProcess"/>
<transition to="evaluateSendBillSubProcess"/>
</fork>
<decision name="evaluateShipGoodsSubProcess">
<handler class="com.yahoo.ionix.workflow.forktest.ShipGoodsEvaluator"
/>
<transition name="SKIP" to="joinWork"/>
<transition name="CALL_SP" to="shipGoodsSubProcess"/>
</decision>
<sub-process name="shipGoodsSubProcess"
sub-process-key="ShipGoodsChild">
<transition name="joinWork" to="joinWork"/>
</sub-process>
<decision name="evaluateSendBillSubProcess">
<handler class="com.yahoo.ionix.workflow.forktest.SendBillEvaluator"
/>
<transition name="SKIP" to="joinWork"/>
<transition name="CALL_SP" to="sendBillSubProcess"/>
</decision>
<sub-process name="sendBillSubProcess"
sub-process-key="SendBillChild">
<transition name="joinWork" to="joinWork"/>
</sub-process>
<join name="joinWork" multiplicity="2"
lockmode="upgrade">
<transition to="afterJoin"/>
</join>
<java class="com.yahoo.ionix.workflow.forktest.TestHelper"
method="afterJoin" name="afterJoin">
<transition to="endMe"/>
</java>
<end name="endMe"/>
</process>
2. send-bills.jpdl.xml
<process key="SendBillChild" name="SendBillChild"
version="1"
xmlns="http://jbpm.org/4.3/jpdl">
<start>
<transition to="sendBill"/>
</start>
<java class="com.yahoo.ionix.workflow.forktest.TestHelper"
method="sendBill" name="sendBill">
<transition continue="async" to="endSendBill"/>
</java>
<end g="353,67,48,48" name="endSendBill"/>
</process>
3. ship-goods.jpdl.xml
<process key="ShipGoodsChild" name="ShipGoodsChild"
version="1"
xmlns="http://jbpm.org/4.3/jpdl">
<start>
<transition to="shipGoods"/>
</start>
<java class="com.yahoo.ionix.workflow.forktest.TestHelper"
method="shipGoods" name="shipGoods">
<transition continue="async" to="endShipGoods"/>
</java>
<end name="endShipGoods"/>
</process>
B. TestCode Snippets:
----------------------------------
@Test(groups="unit")
public void testJBPM() throws Exception {
System.out.println(">>>>>>> test Fork/Join of JBPM
");
deployForkWithSubProcess();
int threadCount = 100;
try {
ExecutorService startService = Executors.newFixedThreadPool(threadCount);
for (int i = 0; i < threadCount; i++) {
startService.execute(new StartTestInstances(this));
}
startService.shutdown();
startService.awaitTermination(1000000, TimeUnit.SECONDS);
} catch (Exception e) {
e.printStackTrace();
}
try {
Thread.sleep(120 * 1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
displayStats();
System.out.println(">>>>>>> testJBPM done ");
}
private void deployForkWithSubProcess() throws Exception {
deploy("workflows/jpdls/send-bill.jpdl.xml");
deploy("workflows/jpdls/ship-goods.jpdl.xml");
deploy("workflows/jpdls/fork-test.jpdl.xml");
}
public static void displayStats(){
log.info(">>>>>>>>>>> Load Test
Statistics");
log.info(">>>>>>>>>>> beforeForkCnt: "
+ beforeForkCnt.get());
log.info(">>>>>>>>>>> shipGoodsCnt: " +
shipGoodsCnt.get());
log.info(">>>>>>>>>>> sendBillCnt: " +
sendBillCnt.get());
log.info(">>>>>>>>>>> afterJoinCnt: " +
afterJoinCnt.get());
}
C. Result Obtained :
----------------------------
>>>>>>>>>> Load Test Statistics
beforeForkCnt: 100
shipGoodsCnt: 100
sendBillCnt: 100
afterJoinCnt: 83
>>>>>> testJBPM done
Observation:
--------------------
The count of afterJoinCnt shows that not all forked processes have joined and came to an
end.
Many of them have been lost and on checking the DB, found that there were many executions
in "inactive-join" state [jbpm4_execution table].
We are currently very much in need of this fix, as it would greatly improve the
performance of our system with time due to the forking nature.
Thanks in advance,
Rajesh.
executions stuck in join activity
---------------------------------
Key: JBPM-2888
URL:
https://jira.jboss.org/browse/JBPM-2888
Project: jBPM
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 4.3
Reporter: Alejandro Guizar
Assignee: Alejandro Guizar
Fix For: jBPM 4.x
The fork node starts the execution of both the branches in parallel by using inbuilt jBPM
messaging. We have observed that the job executor picks up both the jobs and starts
executing them concurrently. However the workflow never enters the join state.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira