This content has been marked as final.
Show 8 replies
-
1. Re: Superstate-enter event not fired
jeanbobby Jun 5, 2007 8:35 AM (in response to jeanbobby)from the doc : (http://docs.jboss.com/jbpm/v3/userguide/processmodelling.html#superstateevents)
9.6.2. Superstate events ... These events will be fired no matter over which transitions the node is entered or left respectively
I cant find anything more precise about the expected behaviour -
2. Re: Superstate-enter event not fired
estaub Jun 5, 2007 8:59 AM (in response to jeanbobby)jb,
It looks like a bug to me - I'd JIRA it and see what response you get.
Maybe the intent was to not allow transitions to the superstate. One way or another, though, there's probably something that needs doing.
-Ed Staub -
3. Re: Superstate-enter event not fired
jeanbobby Jun 5, 2007 9:10 AM (in response to jeanbobby)Ok, thanks Ed.
Copy/paste from the post is detailed enough ? -
4. Re: Superstate-enter event not fired
estaub Jun 5, 2007 9:16 AM (in response to jeanbobby)jb,
Copy/paste from the post is detailed enough ?
It would be for me. I'd include the doc reference too.
-Ed Staub -
-
6. Re: Superstate-enter event not fired
tom.baeyens Sep 5, 2007 8:11 AM (in response to jeanbobby)before the test "if (destination.getSuperState()!=null)", look at how the destination is set to the first node inside the superstate:
Node destination = to; while (destination instanceof SuperState) { destination = (Node) ((SuperState) destination).getNodes().get(0); } ... // performance optimisation: check if at least there is a candidate superstate to be entered. if ( destination.getSuperState()!=null ) {
the following test succeeds:public void testSuperStateEnterViaTransitionToSuperState() { processDefinition = ProcessDefinition.parseXmlString( "<process-definition>" + " <start-state name='start'>" + " <transition to='superstate'/>" + " </start-state>" + " <super-state name='superstate'>" + " <event type='superstate-enter'>" + " <action class='org.jbpm.graph.exe.SuperStateActionExecutionTest$Recorder' />" + " </event>" + " <super-state name='nestedsuperstate'>" + " <event type='superstate-enter'>" + " <action class='org.jbpm.graph.exe.SuperStateActionExecutionTest$Recorder' />" + " </event>" + " <state name='insidenestedsuperstate' />" + " </super-state>" + " </super-state>" + "</process-definition>" ); // create the process instance processInstance = new ProcessInstance(processDefinition); processInstance.signal(); assertEquals(3, executedActions.size()); // the first action called is the superstate-enter on the 'superstate' ExecutedAction executedAction = (ExecutedAction) executedActions.get(0); assertEquals("superstate-enter", executedAction.event.getEventType()); assertSame(processDefinition.getNode("superstate"), executedAction.event.getGraphElement()); assertSame(processDefinition.getNode("superstate"), executedAction.eventSource); assertSame(processInstance.getRootToken(), executedAction.token); assertNull(executedAction.node); // the second action called is the superstate-enter on the 'nestedsuperstate' executedAction = (ExecutedAction) executedActions.get(1); assertEquals("superstate-enter", executedAction.event.getEventType()); assertSame(processDefinition.findNode("superstate/nestedsuperstate"), executedAction.event.getGraphElement()); assertSame(processDefinition.findNode("superstate/nestedsuperstate"), executedAction.eventSource); assertSame(processInstance.getRootToken(), executedAction.token); assertNull(executedAction.node); // the third action called is the *propagated* event of the 'nestedsuperstate' to the 'superstate' executedAction = (ExecutedAction) executedActions.get(2); assertEquals("superstate-enter", executedAction.event.getEventType()); assertSame(processDefinition.findNode("superstate"), executedAction.event.getGraphElement()); assertSame(processDefinition.findNode("superstate/nestedsuperstate"), executedAction.eventSource); assertSame(processInstance.getRootToken(), executedAction.token); assertNull(executedAction.node); }
do you see any difference with your scenario ? i can't seem to reproduce like this. i'll give it another try and see if persistenting the execution makes any difference. -
7. Re: Superstate-enter event not fired
tom.baeyens Sep 5, 2007 8:18 AM (in response to jeanbobby)persistence seems to make a difference... i'm investigating.
-
8. Re: Superstate-enter event not fired
kukeltje Sep 5, 2007 6:02 PM (in response to jeanbobby)Tom, persistence seems to make a difference in a lot more cases. See e.g. the combobox test with selectItems.... Sorry for threadjacking ;-)