callbacks begin old_state exit # old? should be deprecated -> use old_state.before_exit instead event before old_state before_exit new_state before_enter new_state enter # old? should be deprecated -> use new_state.before_enter instead ...update state... transition guard transition on_transition event success # if persist successful old_state after_exit new_state after_enter event after rescue event error