Support beforeActionInvoked hook in AbstractStateMachine