Home » Eclipse Projects » Papyrus for Real Time » 'internal' vs 'local' transitions
'internal' vs 'local' transitions [message #1777014] |
Thu, 23 November 2017 15:35 |
Juergen Dingel Messages: 42 Registered: January 2015 |
Member |
|
|
Good morning,
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
|
|
| |
Re: 'internal' vs 'local' transitions [message #1777027 is a reply to message #1777014] |
Thu, 23 November 2017 16:34 |
Ernesto Posse Messages: 438 Registered: March 2011 |
Senior Member |
|
|
I think you have it backwards. What you are calling 'local' is internal and viceversa. From the UML 2.5 spec (formal-15-03-01, p. 312) [1]
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/
[Updated on: Thu, 23 November 2017 16:45] Report message to a moderator
|
|
| | | | |
Re: 'internal' vs 'local' transitions [message #1826975 is a reply to message #1826958] |
Tue, 05 May 2020 14:38 |
Ernesto Posse Messages: 438 Registered: March 2011 |
Senior Member |
|
|
No need to be sorry. You are allowed to ask. That's what the forums are for!
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.
|
|
|
Goto Forum:
Current Time: Sat Oct 12 17:05:35 GMT 2024
Powered by FUDForum. Page generated in 0.05805 seconds
|