Subprocess wait state signal handling not working from parent process (jBPM 4.3)
apurv888 May 26, 2010 10:36 AMFollowing is our main jPDL xml
<?xml version="1.0" encoding="UTF-8"?>
<process name= "PresenceWorkflow" xmlns="http://jbpm.org/4.3/jpdl"> <start g="-9,225,80,40"> <transition to="wait for presence of user" /> </start> <sub-process name="wait for presence of user" sub-process-key="waitForPresence" g="603,195,177,70"> <parameter-in subvar="userDetailsInstance" var="user"/> <parameter-in subvar="timeoutPeriod" var="timeoutPeriodMain"/> <parameter-out subvar="userDetailsInstance" var="user"/> <parameter-out subvar="subinstanceid" var="subinstanceidMain"/> <transition name="timeout" to="state1" g="-47,-20"/> <transition name="success" to="state1" g="369,51:-28,-24"/> </sub-process> <end g="220,486,48,48" name="end1"/> <end-error g="140,488,80,40" name="internal error"/> <state g="649,418,92,52" name="state1" state="naas-wait"> </state> </process> xml version="1.0" encoding="UTF-8"?> < process name="waitForPresence" xmlns=http://jbpm.org/4.3/jpdl> < start g="8,103,80,40"> </ start> < custom class="com.task.WaitForPresenceTask" g="121,105,100,52" name="wait for presence"> </ custom> < decision expr="#{TaskCompletionStatus}" name="task completion check for wait presence" g="287,117,110,92"> </ decision> < state name="wait for presence update" g="482,114,210,40"> </ state> < end name="success" g="666,410,80,40"/> <end name="failure" g="277,415,80,40"/> < end name="timeout" g="445,414,48,84"/> </ process> Sample test case extract: // start the main process final ProcessInstance processInstance = executionService.startProcessInstanceByKey("PresenceWorkflow", variables,processInstanceKey); // send signal to subprocess to get out of "wait for presence update" state. executionService.signalExecutionById(processInstance.getId(),"AVAILABLE"); Problem faced: 1) Once execution resumes after sending the above signal workflow exists the subprocess without executing any subsequent tasks. For example, the end event listener is not invoked. 2) Unable to get the subprocess execution id. Even if we get the execution id via a hack, we get an exception sending the signal. Any help would be very much appreciated.