Transition
A transition is an element of a state machine that connects two vertices. Transitions are triggered by events.
A transitions belongs to a state machine.
Symbol
A transition is shown as an arrow that connects two vertices.
Characteristics
A transition always has a source vertex and a target vertex.
A transition can have:
A transition is enabled when the following conditions are simultaneously true:
-
The source vertex is active.
-
The guard was evaluated to true.
-
The ID of the current event matches one of the transition's triggers.
A transition can be part of a compound transition. A compound transition takes a state machine from an active state configuration to another and represents the response of the state machine to an event.
Transition kinds
Transition can have one of the following types:
-
local
-
internal
-
external
The default kind of a transition is external.
A transition that enters a pseudostate must be an external transition.
local
The local transition doesn't exit the source state. The source and the target of the local transition must be in an ancestor relationship.
Executing the transition in the example above:
-
The do behavior of the transition is executed.
-
The enter behavior of 'Simple state 1' is executed.
-
The do behavior of 'Simple state 1' is executed.
internal
An internal transition has the same state as the source and target. The internal transition doesn't exit and re-enter the state in which is defined. This means that the entry and exit behaviors are not executed.
Executing the transition in the example above only
-
The do behavior of the transition is executed.
-
The do behavior of 'Simple state 1' is executed.
external
Example 1
Example 2
An external transition causes the exiting of the source vertex.
Executing the transition in example 1:
-
The exit behavior of 'Simple state 1' is executed.
-
The exit behavior of 'Composite state 1' is executed.
-
The do behavior of the transition is executed.
-
The enter behavior of 'Simple state 2' is executed.
-
The do behavior of 'Simple state 2' is executed.
Executing the transition in example 2:
-
The exit behavior of 'Composite state 1' is executed.
-
The do behavior of the transition is executed.
-
The enter behavior of 'Composite state 1' is executed.
-
The enter behavior of 'Simple state 1' is executed.
-
The do behavior of 'Simple state 1' is executed.
Interpretation of and deviation from the UML specification
There is no interpretation of and deviation from the UML specification for a state machine's transition.