[jboss-user] [jBPM] - JBPM stuck when reach AdHocSubprocess and stop executing when reach IntermediateThrowEvent

Kiattchai Preecha-anusond do-not-reply at jboss.com
Wed Feb 22 22:11:10 EST 2012


Kiattchai Preecha-anusond [https://community.jboss.org/people/kiattchaipr] created the discussion

"JBPM stuck when reach AdHocSubprocess and stop executing when reach IntermediateThrowEvent"

To view the discussion, visit: https://community.jboss.org/message/718943#718943

--------------------------------------------------------------
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?
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/718943#718943]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120222/1e6ad361/attachment.html 


More information about the jboss-user mailing list