Completion transitions and implicit triggers

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)!
Click on the image to view it full size
From UML-2.5.1:

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 Cameo Simulation Toolkit® please visit also this video page:

ASIDE: If you try to fire Valid during the 'entry' Activity with a timer in Cameo Simulation Toolkit® (19SP3) it crashes:
Thanks to Prof. Bran Selić of Monash University and ACM for input and discussion.
Up next
Snippets (quotes/extracts)
Visit also
Visit also (backlinks)
Related slides (other tutorials)
Related slides (other tutorials, backlinks)