private function performTransition(Transition $transition, $message = null)
{
// every method in this core routine has hook methods, event handlers and
// callbacks it can call during the execution phase of the
// transition steps if they are available on the domain model.
try {
if (!$this->doCheckCanTransition($transition)) {
// one of the guards returned false or transition not found on current state.
return false;
}
// state exit action: performed when exiting the state
$this->doExitState($transition);
// the transition is performed, with the associated logic
$this->doTransition($transition, $message);
// state entry action: performed when entering the state
$this->doEnterState($transition);
} catch (Exception $e) {
$this->handlePossibleNonStatemachineException($e, Exception::SM_TRANSITION_FAILED, $transition);
}
return true;
}