|Re: local transitions using/not using entry points [message #1776584 is a reply to message #1776573]
||Fri, 17 November 2017 21:38
| Ernesto Posse
Registered: March 2011
I can confirm that if the transition goes from the entry point to the substate, it is not taken, but actually, the problem is kind of subtle, and I'm not sure it's a bug. If instead of using an entry point you use an exit point, it works as expected.|
The idea is that Ponger is in state Playing::State2 when it receives ping, and since this state doesn't have any outgoing transitions whose trigger matches the incoming message, its containing state (Playing) is considered next. But only the "exiting" transitions of Playing are considered, and "exiting" transitions are those who leave the state or which start in one of the state's exiting points. This is because when you are taking a transition you are "leaving" the source state. In this case, you are not really leaving, but only the state's outgoing transitions are considered.
The code generator uses the following terminology (which is not "official" UML-RT terminology, but I find it useful anyway):
An outgoing transition is either a direct outogoing transition or an indirect outgoing transition. A direct outgoing transition of a state S is a transition whose source is S itself. An indirect outgoing transition of S is a transition whose source is an exit point of S.
Similarly for incoming transitions and entry points.
So in your example, when you connect the transition to the entry point, it is considered an incoming transition, not an outgoing transition, and therefore it would not become enabled when the message arrives.
Powered by FUDForum
. Page generated in 0.01905 seconds