Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function execute(Execution $execution)
 {
     $execution->getEngine()->notify(new ActivityStartedEvent($this->activityId, $execution, $execution->getEngine()));
     $execution->getEngine()->info('ENTER: scope <{scope}> at level {level} using {execution}', ['scope' => $this->activityId, 'level' => $execution->getExecutionDepth(), 'execution' => (string) $execution]);
     $root = $execution->createNestedExecution($execution->getProcessModel(), $execution->getNode(), true);
     $root->waitForSignal();
     $this->createEventSubscriptions($root, $this->activityId, $execution->getNode());
     $this->enter($root->createExecution(false));
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function execute(Execution $execution)
 {
     $engine = $execution->getEngine();
     $activityId = $execution->getNode()->getId();
     $engine->notify(new ActivityStartedEvent($activityId, $execution, $engine));
     parent::execute($execution);
     $engine->notify(new ActivityCompletedEvent($activityId, $execution, $engine));
 }
Exemplo n.º 3
0
 public function signal(Execution $execution, $signal, array $variables = [], array $delegation = [])
 {
     $sub = $execution->getEngine()->findExecution($delegation['executionId']);
     if (!$sub instanceof Execution) {
         throw new \RuntimeException('Missing reference to nested execution');
     }
     foreach ($this->outputs as $target => $source) {
         if ($sub->hasVariable($source)) {
             $execution->setVariable($target, $sub->getVariable($source));
         }
     }
     $execution->takeAll(NULL, [$execution]);
 }
Exemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 public function execute(Execution $execution)
 {
     $execution->getEngine()->notify(new ActivityStartedEvent($execution->getNode()->getId(), $execution, $execution->getEngine()));
     $this->createEventSubscriptions($execution, $execution->getNode()->getId());
     $this->enter($execution);
 }
Exemplo n.º 5
0
 /**
  * Get the BPMN process engine instance.
  * 
  * @return ProcessEngine
  */
 public function getEngine()
 {
     return parent::getEngine();
 }