Hi I'm trying to make a custom fork. The number of the Transitions is dynamic
and different in each process instance. In the process definition I have added
one Transition leaving from the fork. A loop in its action handler, creates new
tokens for 1-n times and lets the current token to do the n Transition.
|
| public void execute(ExecutionContext executionContext) throws Exception
{
|
| String parts =
(String)executionContext.getContextInstance().getVariable("txtParticipantList");
| String p =
(String)executionContext.getContextInstance().getVariable("tmpParticipant");
| String[] users = parts.split(",");
|
| if (p == null || p.equals("")){
| Transition transition = executionContext.getTransition();
| for (int j=0; j<users.length-1; j++) {
| String user = users[j];
| Token newToken = new Token(executionContext.getToken(),
"dist." + j);
| //newToken.setTerminationImplicit(true);
| executionContext.getJbpmContext().save(newToken);
| ExecutionContext newExecutionContext = new
ExecutionContext(newToken);
| newExecutionContext.setVariable("tmpParticipant", user);
| newExecutionContext.setVariable("pCount",
Integer.toString(users.length));
|
executionContext.getTransitionSource().leave(newExecutionContext, transition);
| }
| executionContext.setVariable("txtParticipant",
users[users.length-1]);
| executionContext.setVariable("pCount",
Integer.toString(users.length));
| }
| else{
|
executionContext.getContextInstance().setVariable("txtParticipant", p);
| executionContext.setVariable("pCount",
Integer.toString(users.length));
| }
|
| }
|
|
The swimlane for the task after the fork is
| <swimlane name="reviewer">
| <assignment expression="variable(txtParticipant)"/>
| </swimlane>
|
My problem is that the 'txtParticipant' although is set, the delegation doesn't
see. It thinks that is null and throws delegation exceptions.
I was based on that:
http://wiki.jboss.org/wiki/attach?page=ForEachForkActionHandler%2FForEachForkActionHandler.java
Any ideas?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3935769#3935769
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3935769
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user