[jboss-user] [jBPM] - jBPM 3.2: Trouble understanding RuntimeActions and fork/join

Ruediger Herrmann do-not-reply at jboss.com
Wed Jul 21 10:31:16 EDT 2010

Ruediger Herrmann [http://community.jboss.org/people/ruediger.herrmann%40gmx.de] created the discussion

"jBPM 3.2: Trouble understanding RuntimeActions and fork/join"

To view the discussion, visit: http://community.jboss.org/message/553746#553746

I am having trouble in understanding the amount and order of runtimeActions being triggered in a process definition that contains a fork node. The process definition is rather simple, a fork node has two leaving transitions, each pointing to a plain node (called lane1 and lane2). Each of the two nodes has one leaving transition to one common join node. Apart from a start and end node, that's all.  At runtime I want to be informed whenever a node is entered or left. Therefor I attached runtimeActions for Event.EVENTTYPE_NODE_ENTER and Event.EVENTTYPE_NODE_LEAVE to each node. The output is printed below: node-leave: StartState(start) node-enter: Fork(fork) node-leave: Fork(fork) node-enter: Node(lane1) node-leave: Fork(fork) node-enter: Node(lane2) node-leave: Node(lane1) node-enter: Join(join) node-leave: Node(lane2) node-enter: Join(join) node-leave: Join(join) node-enter: EndState(end)  What puzzles me is that leave-Fork and enter-Join occur twice.  The process instance is executed with the following code:   void signalToken( Token token ) {     Map children = token.getChildren();     if( children != null ) {       Collection childTokens = children.values();       for( Token childToken : childTokens ) {         signalToken( childToken );       }     }     if( !token.hasEnded() ) {       token.signal();     } signalToken is initially called with processInstance.getRootToken() as the  argument.  Attached is a standalone snippet to reproduce what I described. Can anyone explain what is going on or what I am doing wrong?  TIA Rüdiger


Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100721/855e041d/attachment.html 

More information about the jboss-user mailing list