UML state diagram definition

74 views Asked by At

In a state machine diagram, actions can be executed within states and also during transitions?

This definition is true or false?

1

There are 1 answers

0
bruno On

yes, replacing 'actions' by 'behavior' to be more precise (and in a state machine, 'diagram' is not relevant here)

from formal/2017-12-05 §14.2.3.4.3 State entry, exit, and doActivity Behaviors :

A State may have an associated entry Behavior. This Behavior, if defined, is executed whenever the State is entered through an external Transition. In addition, a State may also have an associated exit Behavior, which, if defined, is executed whenever the State is exited.

A State may also have an associated doActivity Behavior. This Behavior commences execution when the State is entered (but only after the State entry Behavior has completed) and executes concurrently with any other Behaviors that may be associated with the State, until:

  • it completes (in which case a completion event is generated) or
  • the State is exited, in which case execution of the doActivity Behavior is aborted.

The execution of a doActivity Behavior of a State is not affected by the firing of an internal Transition of that State.

and from formal/2017-12-05 § 14.2.3.8 Transitions :

A Transition ... It may have an associated effect Behavior, which is executed when the Transition is traversed (executed).

A Behavior can be an OpaqueBehavior, Activity, StateMachine, or Interaction (see formal/2017-12-05 § 13.4.2.4 Specializations concerning the abstract class Behavior)