protected function collectExecutions(Execution $execution, Node $node = NULL) { $executions = [$execution]; foreach ($execution->findChildExecutions($node) as $child) { foreach ($this->collectExecutions($child, $node) as $exec) { $executions[] = $exec; } } return $executions; }
/** * {@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); }
/** * Find all inactive concurrent executions (e.g. any execution runs "in parallel" to this execution). * * @param Node $node Optional filter, return only executions that have arrived at the given node. * @return array<Execution> All matching inactive concurrent executions. */ public function findInactiveConcurrentExecutions(Node $node = NULL) { if ($this->parentExecution === NULL) { return []; } return array_filter($this->parentExecution->findChildExecutions($node), function (Execution $execution) { return $execution->isConcurrent() && !$execution->isActive(); }); }