A synchronous FSM that triggers events when entering or leaving a state.