Exemplo n.º 1
0
 /**
  * Take a transition from the given node.
  * 
  * @param string $transition ID of the transition, ommitting it will assume a single outgoing transition.
  * 
  * @throws \RuntimeException When the execution has been terminated.
  */
 public function take($transition = NULL)
 {
     if ($this->isTerminated()) {
         throw new \RuntimeException(sprintf('Cannot take transition in terminated %s', $this));
     }
     if ($transition !== NULL && !$transition instanceof Transition) {
         $transition = $this->model->findTransition($transition);
     }
     $this->engine->pushCommand($this->engine->createTakeTransitionCommand($this, $transition));
 }