*/
public void testMultipleConcurrentEndsInsideEmbeddedSubProcessWithWaitState() {
ActivityInstanceVerification verifier = new ActivityInstanceVerification();
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("start")
.initial()
.behavior(new Automatic())
.executionListener(ExecutionListener.EVENTNAME_START, verifier)
.executionListener(ExecutionListener.EVENTNAME_END, verifier)
.transition("embeddedsubprocess")
.endActivity()
.createActivity("embeddedsubprocess")
.scope()
.behavior(new EmbeddedSubProcess())
.executionListener(ExecutionListener.EVENTNAME_START, verifier)
.executionListener(ExecutionListener.EVENTNAME_END, verifier)
.createActivity("startInside")
.behavior(new Automatic())
.executionListener(ExecutionListener.EVENTNAME_START, verifier)
.executionListener(ExecutionListener.EVENTNAME_END, verifier)
.transition("fork")
.endActivity()
.createActivity("fork")
.behavior(new ParallelGateway())
.executionListener(ExecutionListener.EVENTNAME_START, verifier)
.executionListener(ExecutionListener.EVENTNAME_END, verifier)
.transition("endInside1")
.transition("wait")
.transition("endInside3")
.endActivity()
.createActivity("endInside1")
.behavior(new End())
.executionListener(ExecutionListener.EVENTNAME_START, verifier)
.executionListener(ExecutionListener.EVENTNAME_END, verifier)
.endActivity()
.createActivity("wait")
.behavior(new WaitState())
.executionListener(ExecutionListener.EVENTNAME_START, verifier)
.executionListener(ExecutionListener.EVENTNAME_END, verifier)
.transition("endInside2")
.endActivity()
.createActivity("endInside2")
.behavior(new End())
.executionListener(ExecutionListener.EVENTNAME_START, verifier)
.executionListener(ExecutionListener.EVENTNAME_END, verifier)
.endActivity()
.createActivity("endInside3")
.behavior(new End())
.executionListener(ExecutionListener.EVENTNAME_START, verifier)
.executionListener(ExecutionListener.EVENTNAME_END, verifier)
.endActivity()
.transition("end")
.endActivity()
.createActivity("end")
.behavior(new End())
.executionListener(ExecutionListener.EVENTNAME_START, verifier)
.executionListener(ExecutionListener.EVENTNAME_END, verifier)
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
assertFalse(processInstance.isEnded());
PvmExecution execution = processInstance.findExecution("wait");
execution.signal(null, null);