/** * Visualizes the current state of the workflow execution. * * @param ezcWorkflowExecution $execution */ protected function visualize(ezcWorkflowExecution $execution) { $activatedNodes = array(); foreach ($execution->getActivatedNodes() as $node) { $activatedNodes[] = $node->getId(); } if ($this->options['includeVariables']) { $variables = $execution->getVariables(); } else { $variables = array(); } $visitor = new ezcWorkflowVisitorVisualization(); $visitor->options['highlightedNodes'] = $activatedNodes; $visitor->options['workflowVariables'] = $variables; $execution->workflow->accept($visitor); file_put_contents(sprintf('%s%s%s_%03d_%03d.dot', $this->options['directory'], DIRECTORY_SEPARATOR, $execution->workflow->name, $execution->getId(), ++$this->fileCounter), $visitor); }
/** * Called after a variable has been unset. * * @param ezcWorkflowExecution $execution * @param string $variableName */ public function afterVariableUnset(ezcWorkflowExecution $execution, $variableName) { $this->notifyListeners(sprintf('Unset variable "%s" for execution #%d of workflow "%s" (version %d).', $variableName, $execution->getId(), $execution->workflow->name, $execution->workflow->version), ezcWorkflowExecutionListener::DEBUG); }