Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forums'internal' vs 'local' transitions
https://www.eclipse.org/forums/index.php/mv/msg/1090205/1777014/#msg_1777014
the 'Properties' view of a transition contains buttons for 'internal', 'local', and 'external' kinds.
Assuming the transition is inside a composite state s, my understanding is that a 'local' transition t
- has s as source and target (i.e., it is a self transition), and
- does not leave s, i.e., entry/exit of s are not executed, and
- can be taken from any (direct) substate in s (since its source is a composite state), and
- upon completion, reactivates the substate that was active right before t was taken (i.e., implicit return to (deep) history).
What is an 'internal' transition?
As usual, 'thank you'!
Juergen]]>Juergen Dingel2017-11-23T15:35:56-00:00Re: 'internal' vs 'local' transitions
https://www.eclipse.org/forums/index.php/mv/msg/1090205/1777015/#msg_1777015
Is an 'internal' transition a transition just like a 'local' (see above), except that it leads to a (direct) substate of s, i.e.,
after the transition is taken, the targetted substate becomes active and we do not 'return to history'?
Juergen]]>Juergen Dingel2017-11-23T15:41:31-00:00Re: 'internal' vs 'local' transitions
https://www.eclipse.org/forums/index.php/mv/msg/1090205/1777027/#msg_1777027
Quote:
Transition kinds relative to source
The semantics of a Transition depend on its relationship to its source Vertex. Three different possibilities are defined, depending on the value of the Transition's kind attribute:
kind = external means that the Transition exits its source Vertex. If the Vertex is a State, then executing this Transition will result in the execution of any associated exit Behavior of that State.
kind = local is the opposite of external, meaning that the Transition does not exit its containing State (and, hence, the exit Behavior of the containing State will not be executed). However, for local Transitions the target Vertex must be different from its source Vertex. A local Transition can only exist within a composite State.
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.
[1] http://www.omg.org/spec/UML/2.5/]]>Ernesto Posse2017-11-23T16:34:33-00:00Re: 'internal' vs 'local' transitions
https://www.eclipse.org/forums/index.php/mv/msg/1090205/1777035/#msg_1777035
Juergen]]>Juergen Dingel2017-11-23T20:06:46-00:00Re: 'internal' vs 'local' transitions
https://www.eclipse.org/forums/index.php/mv/msg/1090205/1777037/#msg_1777037
]]>Ernesto Posse2017-11-23T20:15:52-00:00Re: 'internal' vs 'local' transitions
https://www.eclipse.org/forums/index.php/mv/msg/1090205/1777056/#msg_1777056
Another important aspect I would say is that an 'internal' transition, compared to 'local' and 'external' transitions, is that that it is not visualized as an edge in the diagram. An 'internal' transition is only shown in the internal transitions compartment of the composite state.
So when it comes to the special case of self-transitions for a composite state you have external self-transitons shown as edges on the "outside" of the composite state, you have internal self-transitions shown as edges on the "inside" of the composite state, and you have internal transitions shown in the internal transitions compartment (both on the "inside" and "outside") of the composite state.
So in practice there is a recommendation to use internal self-transitions instead of local self-transitions, as well as external self-transitions in the case the composite state does not have any entry or exit code, to reduce graphical "clutter".
PS. The compartment for internal transitions on the "inside" of a composite state is unfortunately shown inside the state frame itself, which can cause issues in case you have entry and exit points on the bottom border of the state frame. The idea is to have the internal transitions shown in a "compartment" outside and below the state frame itself. See bug 511471 tracking an improvement in this area. DS.]]>Peter Cigehn2017-11-24T07:51:02-00:00Re: 'internal' vs 'local' transitions
https://www.eclipse.org/forums/index.php/mv/msg/1090205/1826958/#msg_1826958
Isn't it so that an internal transition is a local transition viewed from a higher nesting level ?
Thanks for answering!
]]>Pieter Jan Bleichrodt2020-05-05T10:49:00-00:00Re: 'internal' vs 'local' transitions
https://www.eclipse.org/forums/index.php/mv/msg/1090205/1826975/#msg_1826975
The difference comes from UML itself. See Message 1777027 in this thread.
An internal transition is just a special case of a local transition, one which is a "loop", i.e. a transition from a state to itself that does not exit the state.
For example, suppose there is a state machine with two states: S1 and S2. Furthermore, S1 is a composite state with substates S11 and S12. Suppose also that you have the following transitions:
- transition t1 from S1 to S2,
- transition t2 from S11 to S12,
- transition t3 from the boundary of S1 to S11,
- transition t4 from the boundary of S1 to itself, but inside S1 (that is, t4 is owned by S1), and
- transition t5 from the boundary of S1 to itself, but outside S1 (that is, t5 is owned by the top-level state machine, the container of S1)
Then, according to the UML 2.5 spec:
- t1 is external (to S1)
- t2 is external (to S11)
- t3 is local (to S1)
- t4 is internal (to S1)
- t5 is external (to S1)
In terms of syntax, the difference between t4 and t5 is the owner of the transition.
In terms of semantics, the difference between t4 and t5 is that if t5 is triggered, the machine exists S1, which means that it first exists whichever internal state of S1 was active (recursively) and S1's exit action is executed. Then the transition's action is executed, then S1's entry action, and then it goes to history, i.e. it enters the last active substate. On the other hand, if t4 is triggered, the machine exists from currently active substate of S1, but it does *not* exit S1. It's transition action is executed and then it goes to history (enters the last active substate) without executing S1's entry action.
A local transition such as t3 is like an internal one but instead of going to the boundary of the state, it goes to a substate directly. So while an internal transition, if triggered, goes to history, i.e. the last active substate, a local transition goes directly to a specific state, rather than history.