HSM behavior data file is created and
modified with the LabHSM Editor. The main screen of the
editor is shown below.

LabHSM Editor Main
Screen.
Despite statecharts were developed as
a graphical formalism, the state structure of an HSM is
just a tree, so it can be suitably depicted with just a
tree control. The State control allows selecting a
current state. The currently selected state can then be
dragged within the state control to another position,
deleted, renamed, set as default, or a substate can be
added to it. Entry and Exit actions can be assigned to
the state in the respective controls. The right part of
the screen provides access to an array of transitions
for the selected state. Transition information consists
of the Target State, Transition Type, Event that
triggers the transition, its priority, a list of Event
Handling Actions, and an Override Flag.
In the presence of behavior
inheritance, the concept of To (Deep) History
transitions, possible entry and exit actions for states
positioned at different levels of hierarchy, determining
the actual target state and the full list of the actions
that must run in a particular transition becomes nothing
but trivial. It is all handled automatically, partially
by the LabHSM editor when saving HSM file, partially –
by the Run State Machine action at run time. However,
the developer sometimes will want to make sure at design
time that the HSM will run exactly the actions he
expects it to run and will end up in the state he
expects it to. For this purpose, the LabHSM Editor is
equipped with the What If…? Screen shown below.

LabHSM Editor What
If...?
Screen.
It allows entering a source state, choosing an
event, and the latest active substate of the target
state (if applicable). Then the editor (based also on
what was entered in the main screen, of course) will
show which state will become the actual target state and
the full list of the transition actions.