[jboss-user] [JBoss jBPM] - Re: ProcessInstance ending changed
kukeltje
do-not-reply at jboss.com
Tue Jan 13 18:44:31 EST 2009
I tried this and was able to run it inspite of a small error in your processdefinition (task2 is in the processstate ;-) )
You signal the 'child-token' which is in the proces-state node, not in the subprocess itself. So to me ending that does not signal any parent node. It does transition this specific token to the next one. I think that should maybe not happen but still...
If you want the subprocess to end and not signal the parent token, then end the rootToken of the subprocess with end(false) like
processInstance.getRootToken().getChild("transition1").getSubProcessInstance().getRootToken().end(false);
If I adapt the unittest this does exactely what you want
ProcessInstance processInstance = jbpmContext.newProcessInstance("MainProcess");
| processInstance.signal();
|
| assertNull(processInstance.getTaskMgmtInstance().getTaskInstances());
|
| assertEquals("subProcess1", processInstance.getRootToken().getChild("transition1").getNode().getName());
|
| // Abort one of the subprocesses
| processInstance.getRootToken().getChild("transition1").getSubProcessInstance().getRootToken().end(false);
|
| assertNull(processInstance.getTaskMgmtInstance().getTaskInstances());
| assertTrue(processInstance.getRootToken().getChild("transition1").getSubProcessInstance().getRootToken().hasEnded());
| assertFalse(processInstance.getRootToken().getChild("transition1").hasEnded());
| assertEquals("subProcess1", processInstance.getRootToken().getChild("transition1").getNode().getName());
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4201537#4201537
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4201537
More information about the jboss-user
mailing list