Stateflow | ![]() ![]() |
History Junctions
History junctions record the previously active state of the state in which they are resident. See the following sections for information on history junctions:
What Is a History Junction?
A history junction is used to represent historical decision points in the Stateflow diagram. The decision points are based on historical data relative to state activity. Placing a history junction in a superstate indicates that historical state activity information is used to determine the next state to become active. The history junction applies only to the level of the hierarchy in which it appears.
Use of History Junctions Example
The following example uses a history junction:
Superstate Power_on
has a history junction and contains two substates. If state Power_off
is active and event switch_on
occurs, the system could enter either Power_on
.Low
or Power_on
.High
. The first time superstate Power_on
is entered, substate Power_on
.Low
is entered because it has a default transition. At some point afterward, if state Power_on
.High
is active and event switch_off
occurs, superstate Power_on
is exited and state Power_off
becomes active. Then event switch_on
occurs. Since Power_on
.High
was the last active state, it becomes active again. After the first time Power_on
becomes active, the choice between entering Power_on
.Low
or Power_on
.High
is determined by the history junction.
See Default Transition and a History Junction Example for more information on the semantics of this notation.
![]() | Flow Diagram Notation with Connective Junctions | History Junctions and Inner Transitions | ![]() |