Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function execute(Execution $execution)
 {
     $nodes = $this->process->findInitialNodes();
     if (count($nodes) !== 1) {
         throw new \RuntimeException(sprintf('No single start node found in process "%s"', $this->process->getTitle()));
     }
     $startNode = array_shift($nodes);
     $sub = $execution->createNestedExecution($this->process, $startNode, true, $this->isolateScope);
     foreach ($this->inputs as $target => $source) {
         if ($execution->hasVariable($source)) {
             $sub->setVariable($target, $execution->getVariable($source));
         }
     }
     $execution->waitForSignal();
     $sub->execute($startNode);
 }