The following rules determine the order in which exiting actions, entering actions, transition actions, and static reactions are carried out for a state transition:
1.
4.
Note: In order to optimize code, you may sometimes want to inline entering/exiting reactions. For more details, see Optimization.