The order of doing exiting actions, entering actions, transition actions and static reactions for a state is as follows:
1. Static reactions are done, as the generated code reveals, in descending order down the state hierarchy, where the state has not changed.
3. Exiting actions are then done, in which all the states that are exited are given an opportunity to do exiting static reactions. Exiting reactions are done from the innermost state to the outermost state.
4. Entering actions are then done, in which all the states that are entered are given an opportunity to do entering static reactions. Entering reactions are done from the outermost state to the innermost state.Note: In specific topologies it is possible, and more efficient, to put the entering/exiting reactions inline, while taking the transition. Use the Compilation Profile->Setting->Optimization flags.In the balance of this section we will discuss the implementation of the following language features: