public function __construct($signal, UUID $executionId = NULL, array $variables = [], VirtualExecution $sourceExecution = NULL) { $this->signal = (string) $signal; $this->variables = serialize($variables); $this->executionId = $executionId; $this->sourceExecutionId = $sourceExecution === NULL ? NULL : $sourceExecution->getId(); }
public function __construct($name, $priority, VirtualExecution $execution = NULL, $documentation = NULL) { $this->name = (string) $name; $this->priority = (int) $priority; $this->executionId = $execution === NULL ? NULL : $execution->getId(); $this->documentation = $documentation === NULL ? NULL : (string) $documentation; }
/** * Create a new persisted event subscription. * * @param string $name Name of the subscription type: "signal", "message", etc. * @param VirtualExecution $execution Target execution. * @param string $activityId ID of the activity that created the event subscription. * @param Node $node Target node to receive the delegated signal or NULL in order to use the activity node. * @param boolean $boundaryEvent Is this a subscription for a boundary event? */ public function __construct($name, VirtualExecution $execution, $activityId, Node $node = NULL, $boundaryEvent = false) { $this->name = (string) $name; $this->executionId = $execution->getId(); $this->activityId = (string) $activityId; $this->nodeId = $node === NULL ? NULL : (string) $node->getId(); $this->boundaryEvent = $boundaryEvent ? true : false; }
/** * {@inheritdoc} */ public function clearEventSubscriptions(VirtualExecution $execution, $activityId) { $engine = $execution->getEngine(); // Delete timer jobs: $stmt = $engine->prepareQuery("\n\t\t\tSELECT `job_id`\n\t\t\tFROM `#__bpmn_event_subscription`\n\t\t\tWHERE `execution_id` = :eid\n\t\t\tAND `activity_id` = :aid\n\t\t\tAND `flags` = :flags\n\t\t\tAND `job_id` IS NOT NULL\n\t\t"); $stmt->bindValue('eid', $execution->getId()); $stmt->bindValue('aid', $activityId); $stmt->bindValue('flags', EventSubscription::TYPE_TIMER); $stmt->transform('job_id', new UUIDTransformer()); $stmt->execute(); $management = $engine->getManagementService(); foreach ($stmt->fetchColumns('job_id') as $jobId) { $management->removeJob($jobId); } $sql = "\n\t\t\tDELETE FROM `#__bpmn_event_subscription`\n\t\t\tWHERE `execution_id` = :eid\n\t\t\tAND `activity_id` = :aid\n\t\t"; $stmt = $engine->prepareQuery($sql); $stmt->bindValue('eid', $execution->getId()); $stmt->bindValue('aid', $activityId); $count = $stmt->execute(); if ($count > 0) { $message = sprintf('Cleared {count} event subscription%s related to activity <{activity}> within {execution}', $count == 1 ? '' : 's'); $engine->debug($message, ['count' => $count, 'activity' => $activityId, 'execution' => (string) $execution]); } }
protected function dumpExecution(VirtualExecution $exec) { $node = $exec->getNode(); $nodeId = $node === NULL ? NULL : $node->getId(); printf("%s%s [ %s ]\n", str_repeat(' ', $exec->getExecutionDepth()), $nodeId, $exec->getId()); foreach ($exec->findChildExecutions() as $child) { $this->dumpExecution($child); } }
public function __construct(VirtualExecution $execution) { $this->executionId = $execution->getId(); }