You should probably post this to the user forum, as it is not a jBPM design issue per se.
However what you want to do is easy to do with an action at a node that has code as
follows where you get forkCount from the size of your collection, e.g.,
| Node fork = rootToken.getNode();
|
| if (forkCount > 0) {
| // create a child token for every fork
| for (int 0 = 1; i < forkCount; i++) {
|
| List<Transition> transitions = fork.getLeavingTransitions();
| Iterator iter = transitions.iterator();
| // need to iterate through the leaving transitions
| // although we only have one
| while (iter.hasNext()) {
| Transition leavingTransition = (Transition) iter.next();
| String childTokenName = leavingTransition.getName();
| Token childToken = new Token(rootToken, childTokenName);
| ci.setVariable("x", x, childToken);
| ExecutionContext childExecutionContext = new ExecutionContext(
| childToken);
| fork.leave(childExecutionContext, childTokenName);
| }
| }
| }
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031133#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...