Maki
|
The undefined state is a predefined state that is active during external transitions. This is a safety feature that is not part of the UML specification.
The undefined state is activated right before the execution of the transition and deactivated (for the benefit of the target state) right after the execution of the transition.
Executing an external transition mainly consists of:
Also, at some point, the target state must be activated (i.e. marked as the active state of the region).
Problem: Any of these steps can throw an exception, and there's no obvious choice for the resulting active state in case of exception.
This is why Maki has made the choice of a third outcome: the activation of another state that doesn't have an entry action (so that its activation can't throw another exception).
Maki defines these two objects:
maki::undefined
, the state builder of the undefined state, to be given to transition tables;maki::states::undefined
, the state object created by maki::undefined
, given to transition hooks.To take advantage of the undefined state, you should define, in every topmost region, a transition whose:
maki::undefined
or any open-ended state sets that contains maki::undefined
(such as maki::all_states
);Such a setup would look like this: