Whenever a state is entered, it executes its entry action before any other action is executed. Whenever a state is exited, it executes its exit action as the final step prior to leaving the state.
See Also:
Action while in a state (do action)