Default Transition

Default transition denotes the state that should be entered, when the state machine is executed with no currently active state.

Use Cases

Default transitions are only relevant in the root of serial threads and states. In parallel threads and extended states, all of the child states are executed according to their execution priority, so, it does not really mean anything to use the default transition.

In case of serial extended states, default transition os only needed if:

  • The state has a parallel parent, or
  • There is a transition ending to the state (not inside it)

Defining Conditional Default Paths

It is possible to decide between multiple states as the default state using Junctions. By adding a Default-Transition-to-Junction, you can branch that default transition into several paths that decide the default state based on some events of conditions. It is worth mentioning that there should always be an unconditional path from a default transition to a state. This guarantees that a state can always be activated, even if none of the conditional paths are valid.

Warning

There should always be an unconditional path from a Default transition to a state. Not meeting this condition will result in code generation failure!