If you want a runtime object to change its State on a Transition, you need to define a Trigger on the Transition by assigning an Event Type to a Transition. A runtime object will change its State when it receives a Trigger on the Transition. A Trigger can be a Signal Event, a Time Event, or a Change Event.


The StopWatch's State Machine diagram with defined Triggers on the Transitions.


Tip

Optionally, you can also use a Send Signal Action of an Activity as a Signal Event of Transition. As shown in the following figure, the stopped State can wait for the off Send Signal Action of the do Activity to proceed to the final State.

The off Send Signal Action of the do Activity as a Signal Event of Transition.

Warning

  • According to UML Version 2.5.1, the initial Transition must not have Triggers or Guards. If the Initial Transition violates the rule, Simulation will print a warning message in the Console pane.
  • Simulation also provides the validation rule to prevent the model error by displaying a warning in the Validation Results panel. You can either select the Check Model Before Execution option through validation and verification before running the simulation or select Pre-execution constraints from the Validation Suite drop-down list in the Validation dialog and click Validate.