private function doTransition(Transition $transition, $message = null)
{
// hook for subclasses to implement
$this->_onTransition($transition);
$entity = $this->getContext()->getEntity();
$identifier = $this->getContext()->getIdentifier();
// an event handler that is possibly defined on the domain model: onTransition
$this->callEventHandler($entity, 'onTransition', $identifier, $transition);
// executes the command and callable associated with the transition object
$transition->process($this->getContext());
// this actually sets the state so we are now in the new state
$this->setState($transition->getStateTo(), $message);
}