[jboss-user] [JBoss jBPM] - Re: Re-routing Tokens

Olivier_Debels do-not-reply at jboss.com
Fri Dec 21 04:08:31 EST 2007

We also use re-routing in our workflows:

* Firstly we use it when we want to split/merge tokens.  The idea here is that we can gradually move in a process instance from a situation where we have:
  - a single token with a reference to a collection of domain objects
  - as much tokens as we have domain objects.
For example a single report can be made about several domain cases, or the user can opt to split it and make different reports for domain cases which belong together.  The user can also opt to merge other domain cases into the current token.  Splitting actually creates new subtokens, merging adds domain cases to the current token and can remove other process instances which were created.  When a user decides to merge a re-route can happen to a certain node in the workflow (is configurable in custom addition in jbpm designer).  Re-routing is done by calling node.leave()

* Secondly we allow the user to reopen task instances under certain circumstances.  For example when having a process with 2 task nodes, making of a report followed by approving the report, and the user has complete the making of a report task but realized he forgot something, he can reopen this task.  In that case the approving of the report task will be removed and the token will be re-routed.  This is actually your case.

* Thirdly when a user did some changes in a process instance with a start task but wants to undo those changes (and he triggered the creation of the process instance), this process instance and task will be removed.  This is not re-routing but simply removing task and processes.

For removing processes and task instances we just make sure they don't appear in the client task lists any more.
- We created methods to end processinstances, subprocessinstances, the tokens and taskinstances they contain.  Clients won 't notice these any more but they still remain in the database.
- The circumstances in which a user can undo/reopen etc... are really specific.  For example your implementation will not work if you have subprocesses or if you fork and have subtokens.

Hope this helps a bit (and is a bit understandeable), 

feel free the comment


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114912#4114912

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114912

More information about the jboss-user mailing list