This project has moved and is read-only. For the latest updates, please go here.

History in StaMa

Feb 6, 2008 at 10:26 PM
Edited Feb 6, 2008 at 10:29 PM
UML defines two kinds of history: Shallow and deep history. As far as I understood UML, deep history is identical with recursively applying shallow history on all sub-states of the region that carries the deep history attribute.
In StaMa there is no built in support for deep history. Further there is no shallow or deep history pseudo state that could be addressed by a transition.
If there is no history pseudo state, how can the stored previous state (history state) be activated?
The idea here is, that the history is a kind of "dynamic" initial state. The initial state per definition is that sub-state of a hierarchical state that is entered when a transition ends at the border of the hierarchical state.
In case the hierarchical state (in StaMa: the embedded region) has a history, the initial state is overridden by the history such that the stored previous state is entered instead of the initial state. The history state is initialized with the initial state on startup.
Recursively applying this pattern on all sub-regions should yield something like a deep history.
A transition is free to target the initial state directly if there is an additional need to alternately enter the true initial sub-state.
The drawback of this pattern is less privacy of the sub-structure of a hierarchical state in case both history and initial state behaviour is needed for the same hierarchical state. The advantage is reduced algorithm complexity inside StaMa.