Tags and keywords
A completion transition is a Transition that has no explicit event, trigger, or guard, and occurs "automatically" when the Behaviors associated with its source State complete.
Use of completion transitions is NOT recommended here! This slide page just explains what they are (and why to avoid them)!
From UML-2.5.1:
ASIDE: If you try to fire
Thanks to Prof. Bran Selić of Monash University and ACM for input and discussion.
UML-2.5.1: '14.2.3.8.3 Completion Transitions and completion events: A special kind of Transition is a completion Transition, which has an implicit trigger. The event that enables this trigger is called a completion event and it signifies that all Behaviors associated with the source State of the completion Transition have completed execution. In case of simple States, a completion event is generated when the associated entry and doActivity Behaviors have completed executing. If no such Behaviors are defined, the completion event is generated upon entry into the State.'
In the example, the Transition from (out of) the state PassThrough
to Next
will always, automatically, be taken as soon as the 'entry' and 'doActivity' complete. So PassThrough
does not act like a State in a purist StateMachine.
By comparison, the Transition for the Signal Valid
will only be taken if it is invoked during the 'doActivity'. And it will have no chance at all once the 'doActivity' finishes:
The takeaway is that it's best to always use explicit events, triggers, or guards on all Transitions.
For a discussion and simulation of this case in Magic Model Analyst® (Cameo Simulation Toolkit®) please visit also this video page:
ASIDE: If you try to fire
Valid
during the 'entry' Activity with a timer in Magic Model Analyst® (Cameo Simulation Toolkit®) (19SP3) it crashes:
Thanks to Prof. Bran Selić of Monash University and ACM for input and discussion.