Skip to main content

Element: Exception transition

An exception transition controls the switch to the next state or pseudo state if an error or an exception occurs. The exception transition has a guard condition and optionally an action.

An exception transition interrupts the current processing. First, the currently active state is processed until the end of the cycle. Then the system switches to the state which is intended as a reaction to this exception. In this state, error handling and exception handling are executed. The source state is usually a composite, orthogonal state.

_uml_img_exception_transition.png

Tip

The exception transition is used to exit a composite state from any substate. Its state is evaluated after the DO action for the active state has been executed. Even when the condition for the exception transition is TRUE the first time a composite state is entered, the DO action of the first state is executed. Because the ENTRY and EXIT actions are not linked to conditions, they are always executed regardless of the exception transition.

You can interpret an exception transition insofar that it does not originate from a composite state, but directly from each substate. The conditions for the exception transitions are evaluated after their DO actions. Because the ENTRY and EXIT actions are not linked to conditions, they are always executed regardless of the exception transition.

Pseudo exception transition

A pseudo exception transition replaces the end state in a composite state.

Figure 1. Notation of a pseudo exception transition
Notation of a pseudo exception transition


Sometimes it is neater to use an exception transition instead of an end state in a composite state. This is then drawn at the edge of the composite state. Then the entire composite state is exited under the condition of the exception transition. However, this use does not imply any error behavior. The properties of the exception transition are therefore defined as a pseudo exception transition. It does not affect the cyclic execution behavior.

Properties

Property

Description

Type

Exception transition

Priority

The priority defines the order of processing.

Example: 3

Note: If the state has other transitions and you change the priority, then all transitions are affected by the change and they are adapted automatically.

Pseudo exception

  • _cds_icon_option_deactivated.png: Normal exception transition. In the editor, this is indicated by a dashed red line. Default.

  • _cds_icon_checked.png: Pseudo exception transition. In the editor, this is indicated by a dashed blue line. The state is exited when the condition is fulfilled. However, this is not an error.

Rising edge

  • _cds_icon_checked.png: When the guard condition yields a rising edge, the transitions run and the state transition is executed.

    Hint: In the editor, an exception transition that behaves this way is indicated by the _uml_icon_transition_rising_edge.png symbol.

  • _cds_icon_option_deactivated.png: When the guard condition is TRUE, the transition is run.

User input

Action

Description

  1. In the ToolBox view, select the Exception transition element.

  2. Click a composite state.

  3. Click another state (target state).

An exception transition with a TRUE condition and an action symbol is generated.

Note

If you do not click an existing element, but in a blank area, then a new state (end state) is created.

  1. Select a composite state.

  2. Click the _uml_icon_tool_transition_exception.png symbol.

  3. Click another state (target state).

An exception transition with a TRUE condition and an action symbol is generated.

  1. Double-click the _uml_transition_condition_default.png symbol.

    An input field opens.

    _uml_icon_input_assistant.png

  2. Select a Boolean variable or a Boolean expression.

When this condition is fulfilled, the switch is made to the transition.

  1. Click _uml_icon_sc_transition_action_2.png two times.

    An inline editor opens.

  2. Specify the name of a program, method, or action.

When you start typing, the matching components appear in a list box. You can double-click to select the object.

This selected method or action is executed when the transition has been switched.

  1. Click a transition, the action symbol, or the guard symbol one time.

    The transition is selected. This is indicated by a blue arrow.

  2. Move the transition.

The line of a transition can be moved anywhere. The states remain in place.

  1. Click the start or end of an exception transition.

    The _uml_icon_reconnect_transition.png symbol is displayed.

  2. Drag the symbol to another state.

You can use this function to move a transition to another state without losing the previous configuration. The corresponding condition and action remain unchanged.