Actions (OOM)

An action is a specification of a computable statement. It occurs in a specific situation and may comprise predefined events (entry, do and exit) and internal transitions.

An action can be created in the following diagrams:

Internal transitions can be defined on a state, they are internal to the state and do not cause a change of state; they perform actions when triggered by events. Internal transitions should not be compared to reflexive transitions on the state because the entry and exit values are not executed when the internal event occurs.

An action contains a Trigger Event property containing the specification of the event that triggers the action.



For more information on events, see Events (OOM).

Action on State and on Transition

In an OOM, an action is used in the statechart diagram in association with states: the action is executed in the state during entry or exit. It is also used in association with transitions: the action is executed when the transition is triggered.

In UML, the difference is that an action is displayed in interaction diagrams (in association with messages) and in statechart diagrams.

When you define an action on a state, you can define several actions without any limitation. When you define an action on a transition, there can only be one action as the transition can execute only one action. An action defined on a state can contain the event that triggers it: the action property sheet contains the event property sheet. An action defined on a transition does not contain the event that triggers it: you can only enter the action in a text field.

In the following figure, you can see actions defined on states, and actions defined on transitions together with the order of execution of actions:



The action icon in the Browser is a two-wheel symbol, it is defined within a state node but does not appear within a transition node.