/**
  * Wake the given execution up using the given signal / variables.
  * 
  * @param Execution $execution
  * @param string $signal
  * @param array $variables
  * @param array $delegation
  */
 public function __construct(Execution $execution, $signal = NULL, array $variables = [], array $delegation = [])
 {
     $this->executionId = (string) $execution->getId();
     $this->signal = $signal === NULL ? NULL : (string) $signal;
     $this->variables = serialize($variables);
     $this->delegation = serialize($delegation);
 }
示例#2
0
 protected function syncRemovedExecution(Execution $execution)
 {
     unset($this->executions[(string) $execution->getId()]);
     $this->debug('Sync removed {execution}', ['execution' => (string) $execution]);
 }
示例#3
0
 /**
  * {@inheritdoc}
  */
 protected function syncRemovedExecution(Execution $execution)
 {
     foreach ($execution->findChildExecutions() as $child) {
         $this->syncRemovedExecution($child);
     }
     $this->conn->delete('#__bpmn_execution', ['id' => $execution->getId()]);
     $this->notify(new ExecutionTerminatedEvent($execution, $this));
     return parent::syncRemovedExecution($execution);
 }
示例#4
0
 /**
  * Have the given execution execute execute the node's behavior.
  * 
  * @param Execution $execution
  * @param Node $node
  */
 public function __construct(Execution $execution, Node $node)
 {
     $this->executionId = $execution->getId();
     $this->nodeId = (string) $node->getId();
 }
示例#5
0
 /**
  * Is being used to notify a parent execution whenever a child execution has been terminated.
  * 
  * @param Execution $execution
  * @param boolean $triggerExecution Trigger / signal this execution?
  */
 protected function childExecutionTerminated(Execution $execution, $triggerExecution = true)
 {
     $removed = false;
     $scope = $execution->isScope() || !$execution->isConcurrent();
     foreach ($this->childExecutions as $index => $exec) {
         if ($exec === $execution) {
             unset($this->childExecutions[$index]);
             $removed = true;
             break;
         }
     }
     if (empty($this->childExecutions) && $scope && $removed && $triggerExecution) {
         if ($this->isWaiting()) {
             $this->signal(NULL, [], ['executionId' => $execution->getId()]);
         } else {
             $this->takeAll(NULL, [$this]);
         }
     }
 }
 /**
  * Have the execution transition into the next node.
  * 
  * @param Execution $execution
  * @param Transition $transition
  */
 public function __construct(Execution $execution, Transition $transition = NULL)
 {
     $this->executionId = $execution->getId();
     $this->transitionId = $transition === NULL ? NULL : (string) $transition->getId();
 }