[jboss-dev-forums] [jBPM Development] - Re: Jump to end state from Node

Martin Weiler do-not-reply at jboss.com
Wed May 18 04:20:10 EDT 2011


Martin Weiler [http://community.jboss.org/people/mputz] created the discussion

"Re: Jump to end state from Node"

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

--------------------------------------------------------------
Using token.setNode(..) should work, what exactly did not work 'as expected'?


I would, however, not recommend to use it because of the following two caveats:
* the process execution logging becomes inconsistent, which might be relevant if audit data of the executed process instances needs to be captured
* it is not visually clear just from looking at the process that the process execution can 'jump' at certain points.

A different approach for your requirement would be to introduce super-states. This concept is basically just a group over several nodes, but with the added benefit that you can add additional outgoing transitions from the super-state. These can be called from any node inside the super-state.


1. FastForward w/o super-state:

start -> node1 -> node2 -> node3 -> node4 -> end


With this process definition, if you want to move from node1 directly to node4, you could only use Token.setNode() with the above mentioned caveats.

2. FastForward w/ super-state:

           ___super-state1___
          |                  |
start  -> | node1 -> node2 ->| node3
          |__________________|   |
                   |             v  
                   `---------> node4 -> end



Here, you can just call the leaving transition of the super-state to node4 from any of the nodes within the super-states. This has the advantage that the logs are created properly, thus it does not break auditing, and that additional events are triggered, which could be used to set/re-set any data or variables.


HTH,
Martin
--------------------------------------------------------------

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

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20110518/5afd4521/attachment.html 


More information about the jboss-dev-forums mailing list