Purpose of State in State Machine

The Exit State activity is mainly designed for:

  • Cleanup & resource release before leaving a state.
  • Resetting variables, flags, or temp data used inside the state, so they don’t affect the next state.
  • Closing connections, killing sessions, logging exit-specific information.
  • Any action that should be performed only when leaving the state, and not during entry or transition.

For your question - It will work as expected without giving value in exit state. But as i have mentioned in the above points - If any of these are valid in your case - It is best suited to provide in the exit state.

@edmondlaw

1 Like