Currently backmp11 supports the same set of active state switch policies as in back:
- before transition / after guard
- after exit of the source state
- after transition action
- after entry of the target state (default)
Apparently the UML specification did not specify exactly when the active state was supposed to switch in the past.
Version 2.5.1 seems to have filled this gap and specifies the exact point in time when the switch is supposed to happen.
Taking below statements from the specification into account results in a "after exit of the source state" state switch policy:
- Entering a state: "Regardless of how a State is entered, the StateMachine is deemed to be “in” that State even before any entry Behavior or
effect Behavior (if defined) of that State start executing."
- Exiting a state: "Regardless of how a State is exited, the StateMachine is deemed to have “left” that State only after the exit Behavior (if
defined) of that State has completed execution."
The specified switch time seems to be a practicable choice. It allows active state visitors to be called with the most intuitive set of states: The source state before it finished its exit behavior, the target state afterwards.
Taking into account that exceptions can abort a transition mid-execution, the switch time specified by UML makes even more sense:
- if the source state's exit hasn't completed, it makes sense to still consider it active
- the transition action and target state entry happen after the completed state exit, using this setting would make the switch time dependent on an unrelated action
Considering composite state entries this setting also seems to be the only reasonable choice in case an exception is thrown during the entry; the state has to be considered active before its entry action is executed, otherwise the active substate(s) of the composite state are not well-defined.
Intended change: Set the default active state switch to "after exit of the source state" in 1.92 and remove the setting in 1.93.
Currently
backmp11supports the same set of active state switch policies as inback:Apparently the UML specification did not specify exactly when the active state was supposed to switch in the past.
Version 2.5.1 seems to have filled this gap and specifies the exact point in time when the switch is supposed to happen.
Taking below statements from the specification into account results in a "after exit of the source state" state switch policy:
effect Behavior (if defined) of that State start executing."
defined) of that State has completed execution."
The specified switch time seems to be a practicable choice. It allows active state visitors to be called with the most intuitive set of states: The source state before it finished its exit behavior, the target state afterwards.
Taking into account that exceptions can abort a transition mid-execution, the switch time specified by UML makes even more sense:
Considering composite state entries this setting also seems to be the only reasonable choice in case an exception is thrown during the entry; the state has to be considered active before its entry action is executed, otherwise the active substate(s) of the composite state are not well-defined.
Intended change: Set the default active state switch to "after exit of the source state" in 1.92 and remove the setting in 1.93.