Search code examples
umltransitioninternalsstatechart

UML Statechart Delving Into vs Internal Transition


I have a question about statechart diagrams below;

enter image description here

I suppose that, in UML, it is possible. In this case, execution order is S1 enter, S3 enter. Am I right? And In the next diagram, what is execution order when occured transiton from "any other state" to s1?

enter image description here


Solution

  • For the first diagram :

    execution order is S1 enter, S3 enter. Am I right?

    yes you are right, from the standard formal/2017-12-05 § 14.2.3.4.5 Entering a State page 310 :

    Explicit entry: If the incoming Transition or its continuations terminate on a directly contained substate of the composite State, then that substate becomes active and its entry Behavior is executed after the execution of the entry Behavior of the containing composite State.

    For the second diagram :

    • it seems to use an entryPoint pseudostate (badly drawn), but the transition from any other state is not going to it but to S1, so to the initial pseudostate, the execution is entryActS1 then entryActS2.

    • if it is not an entry point but a local transition from the border that changes nothing from any other state and the execution is also entryActS1 then entryActS2.


    About the transition indicated internal

    the transition from the possible entryPoint pseudostate or from the border is indicated internal, but internal transitions are self transitions where the source and target are the same state, as said in the standard formal/2017-12-05 §14.2.3.8.1 Transition kinds relative to source page 314 :

    kind = internal is a special case of a local Transition that is a self-transition (i.e., with the same source and target States), such that the State is never exited (and, thus, not re-entered), which means that no exit or entry Behaviors are executed when this Transition is executed. This kind of Transition can only be defined if the source Vertex is a State.

    So the second diagram is illegal :

    • in case of an entry pseudostate rather than to be internal the transition from it is local as said in the standard formal/2017-12-05 § 14.5.11.8 Constraints page 361 :

    state_is_local

    A Transition with kind local must have a composite State or an entry point as its source.

    • in case of a transition from the border it can be local or external, but as it is drawn it is local, see standard formal/2017-12-05 page 335 figure 14.34 Local Transitions and Figure 14.35 External Transitions to see the difference of drawing