Deep history

A deep history is an element of a state machine. It is processed when it is reached by a transition that has the deep history as a target.

The deep history represents the most recent active state configuration of the containing state (recursively). It can have multiple default transitions - at most one for each region of the containing composite state. The default transition(s) is/are taken in case the composite state was not active before the deep history is reached (the first time).

A deep history belongs to a composite state (not to a region).

Symbol

The symbol of a deep history is a circle containing an 'H*' with a star.

images/download/attachments/2785319/deep_history_symbol.png

Symbol in context

images/download/attachments/2785319/deep_history_context_1.png

Example 1

  1. The composite state 'Composite state 1' is entered and becomes active (via the transition emanating from the initial pseudostate).

  2. Composite states 'Composite state 2' and 'Composite state 3' are also entered and become active (via the transitions emanating from the initial pseudostates).

  3. Simple state 'Simple state 1' is entered and becomes active (via the transition emanating from the initial pseudostate).

  4. Events 'E1' is fired. The simple state 'Simple state 3' is entered and becomes active.

  5. Then the event 'E2' is fired. The simple states 'Simple state 2' and 'Simple state 4' are entered and become active.

  6. After event 'E2' is fired, composite state 'Composite state 1' is exited and simple state 'Simple state 5' is entered and becomes active.

  7. Now the automatic transition leaving simple state 'Simple state 5' is processed.

  8. This leads to the composite state 'Composite state 1' being entered again by its deep history. Now 'Simple state 2' and 'Simple state 4' are reactivated because the state 'Composite state 1' was active before.

Example 2

  1. This time, after the composite state 'Composite state 1' is entered, event 'E1' is fired and event 'E2' is not fired.

  2. Then the composite states 'Composite state 2' and 'Composite state 3' are entered respectively.

  3. Simple state 'Simple state 1' is entered and becomes active (via the transition emanating from the initial pseudostate).

  4. The Event 'E1' is fired and simple state 'Simple state 3' is entered and becomes active.

  5. Then the event 'E3' is fired. Once again 'Composite state 1' is exited and 'Simple state 5' is entered.

  6. Now composite state 'Composite state 1' is entered again via its deep history.

  7. This leads to 'Composite state 2' and 'Composite state 3' becoming reactivated. Because the deep history works recursively (no matter how deep), simple state 'Simple state 3' is reactivated directly, too.

  8. The transitions emanating from the initial pseudostates are going to be processed.

Characteristics

  • Deep history works/functions recursively. That means that all child states of the regions of the containing composite state that were active before, are reactivated recursively (remember that the shallow history doesn't reactivate the children).

  • If the target of one of the default transitions is a composite state, than it proceeds with the default entry of the composite state.

  • Composite states can contain at most one deep history.

  • The state machine is considered ill-formed if the containing composite state has never been active before and it has no default transitions.

Interpretation of and deviation from the UML specification

UML specification

  1. At most one transition may originate from the history connector to the default deep history state.

  2. History vertices can have at most one outgoing transition.

yasmine deviation

  1. At most one transition may originate from the history connector per region to the default deep history state in that region of the containing composite state.

  2. History vertices can have more than one outgoing transition, but at most one transition for each region of the containing composite state.