umlstate-machinesysml

Ordering and Timing of State Machine transitions


This is not a problem but more of a fundamental question, that I know will have been implemented differently by each of the tool suppliers, so I want what people believe to be the intended behaviour by the OMG UML/SysML working groups.

In the following image of a complex state, and I know there are a lot of untriggered and only guarded transitions. Is the do behaviour of the state Motion::Active::Debounce trigger if the guard on the exiting transition is true before the entry behaviour is completed?

enter image description here

Or, would you model this in a different manner?


Solution

  • The UML 2.5.1 spec states on p. 309:

    14.2.3.4.3 State entry, exit, and doActivity Behaviors

    [...]

    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.

    So: the doActivity will be triggered but aborted immediately since the exit condition is true. In other words: it will not run.