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));
    }
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));
    }
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 ) ) ; }
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.
Take a transition from the given node .