Transitions

What Is a Transition?

A transition is a line with an arrowhead that links one graphical object to another. In most cases, a transition represents the passage of the system from one mode (state) object to another. A transition typically connects a source and a destination object. The source object is where the transition begins and the destination object is where the transition ends. The following chart shows a transition from a source state, B, to a destination state, A.

Junctions divide a transition into transition segments. In this case, a full transition consists of the segments taken from the origin to the destination state. Each segment is evaluated in the process of determining the validity of a full transition.

The following example has two segmented transitions: one from state On to state Off, and the other from state On to itself:

A default transition is a special type of transition that has no source object. See Default Transitions for details.

Transition Hierarchy

Transitions cannot contain other objects the way that states can. However, transitions are contained by states. A transition's hierarchy is described in terms of the transition's parent, source, and destination. The parent is the lowest level that contains the source and destination of the transition. Consider the parents for the transitions in the following example:

The following table resolves the parentage of each transition in the preceding example. The / character represents the chart. Each level in the hierarchy of states is separated by the period (.) character.

Transition Label

Transition Parent

Transition Source

Transition Destination

switch_off

/

/Power_on.Low.Heat

/Power_off

switch_high

/Power_on

/Power_on.Low.Heat

/Power_on.High

switch_cold

/Power_on.Low

/Power_on.Low.Heat

/Power_on.Low.Cold

Transition Label Notation

A transition is characterized by its label. The label can consist of an event, a condition, a condition action, and/or a transition action. The ? character is the default transition label. Transition labels have the following general format:

event[condition]{condition_action}/transition_action

You replace the names for event, condition, condition_action, and transition_action with appropriate contents as shown in the example Transition Label Example. Each part of the label is optional.

Transition Label Example

Use the following example to understand the parts of a transition label.

Event Trigger.  Specifies an event that causes the transition to be taken, provided the condition, if specified, is true. Specifying an event is optional. The absence of an event indicates that the transition is taken upon the occurrence of any event. Specify multiple events using the OR logical operator (|).

In the preceding example, the broadcast of event E triggers the transition from On to Off as long as the condition [off_count==0] is true.

Condition.  Specifies a Boolean expression that, when true, validates a transition to be taken for the specified event trigger. Enclose the condition in square brackets ([]). See Conditions for information on the condition notation.

In the preceding example, the condition [off_count==0] must evaluate as true for the condition action to be executed and for the transition from the source to the destination to be valid.

Condition Action.  Follows the condition for a transition and is enclosed in curly braces ({}). It is executed as soon as the condition is evaluated as true and before the transition destination has been determined to be valid. If no condition is specified, an implied condition evaluates to true and the condition action is executed.

In the preceding example, if the condition [off_count==0] is true, the condition action off_count++ is immediately executed.

Transition Action.  Executes after the transition destination has been determined to be valid provided the condition, if specified, is true. If the transition consists of multiple segments, the transition action is only executed when the entire transition path to the final destination is determined to be valid. Precede the transition action with a /.

In the preceding example, if the condition [off_count==0] is true, and the destination state Off is valid, the transition action Light_off is executed.

Valid Transitions

In most cases, a transition is valid when the source state of the transition is active and the transition label is valid. Default transitions are different because there is no source state. Validity of a default transition to a substate is evaluated when there is a transition to its superstate, assuming the superstate is active. This labeling criterion applies to both default transitions and general case transitions. The following table lists possible combinations of valid transition labels.

Transition Label

Is Valid If...

Event only

That event occurs

Event and condition

That event occurs and the condition is true

Condition only

Any event occurs and the condition is true

Action only

Any event occurs

Not specified

Any event occurs

Was this topic helpful?