Hello everyone,
I integrated my application with JBPM5.1Final and found some problem when I try to execute AdHocSubprocess or IntermediateThrowEvent that contain EscalationEventDefinition inside. This is some code from the application.
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newFileResource(new File("test.bpmn2")), ResourceType.BPMN2);
KnowledgeBase knowledgeBase = kbuilder.newKnowledgeBase();
StatefulKnowledgeSession kSession = knowledgeBase.newStatefulKnowledgeSession();
kSession.addEventListener(new ProcessEventListener() {
@Override
public void beforeNodeLeft(ProcessNodeLeftEvent arg0) {
System.out.println(arg0.getNodeInstance().getNode().getName());
}
@Override
public void beforeNodeTriggered(ProcessNodeTriggeredEvent arg0) {
System.out.println(arg0.getNodeInstance().getNode().getName());
}
....
});
System.out.println("Start")
kSession.startProcess("process_1");
//kSession.startProcess("process_2");
while (!mKSession.getProcessInstances().isEmpty()) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
System.out.println("Done")
kSession.dispose();
Output: process_1
=====================================
Start
triggered: StartEvent
left: StartEvent
triggered: AdHoc Subprocess
=====================================
Output: process_2
=====================================
Start
triggered: StartEvent
left: StartEvent
triggered: ThrowEscalation
Done
=====================================
It seem that it will struck when found the AdHocSubprocess and stop executing when found the IntermediateThrowEvent. In case of IntermediateThrowEvent, it can execute through to the EndEvent if the IntermediateThrowEvent do not contain the EscalationEventDefinition inside. Could anyone suggest me what is the cause of this problem?