I read the documentation at http://docs.jboss.com/jbpm/v3.2/userguide/html/. It mentions that nodetype node can have customized behavior when it comes to creating new execution paths in the form of a token, also this behavior must be programmed in an action handler.
The node behavior I want to create is when a token arrives, a new token is created and passed on to a leaving transition, the arrived token is passed over the default leaving transition (eventually i will be expanding this to allow for any number of new tokens and any number of leaving transitions).
-----> [Split] -----> ...
| new token
\-----------> ... -> [end-state]
I implemented this in the execute method like this:
Token newToken = new Token(executionContext.getToken(), "split");
ExecutionContext newContext = new ExecutionContext(newToken);
When I run the process I can see that the new tokens are produced and indeed arrive in the end state all seems to be in order as far as I can tell.
Except that calling JbpmContext.getGraphSession().deleteProcessInstance(theInstanceContainingSplitId) (this I use to remove the process from the database while testing) throws a database constraint exception on the foreign key for the token table. Is this because I am doing something wrong while producing the new tokens or is this some bug?
Did not notice that white-space is trimmed on the forum (replacing white space with _)
----->[Split] -----> ...
_______| new token
_______\------------> ... ---> [end-state]