/** * Generate XML representation of this node's configuration. * * @param DOMElement $element * @ignore */ public function configurationToXML(DOMElement $element) { $element->setAttribute('serviceObjectClass', $this->configuration['class']); if (!empty($this->configuration['arguments'])) { $xmlArguments = $element->appendChild($element->ownerDocument->createElement('arguments')); foreach ($this->configuration['arguments'] as $argument) { $xmlArguments->appendChild(ezcWorkflowDefinitionStorageXml::variableToXml($argument, $element->ownerDocument)); } } }
/** * Generate XML representation of this node's configuration. * * @param DOMElement $element * @ignore */ public function configurationToXML(DOMElement $element) { foreach ($this->configuration as $variable => $value) { $variableXml = $element->appendChild($element->ownerDocument->createElement('variable')); $variableXml->setAttribute('name', $variable); $variableXml->appendChild(ezcWorkflowDefinitionStorageXml::variableToXml($value, $element->ownerDocument)); } }
<?php // Set up workflow definition storage (XML). $definition = new ezcWorkflowDefinitionStorageXml('/path/to/directory'); // Save workflow definition to database. $definition->save($workflow);
public function testLoadWorkflowWithSubWorkflowAndVariablePassing() { $definition = new ezcWorkflowDefinitionStorageXml(dirname(dirname(dirname(__FILE__))) . '/Workflow/tests/data/'); $workflow = $definition->loadByName('IncrementVariable'); $this->definition->save($workflow); $this->setUpWorkflowWithSubWorkflowAndVariablePassing(); $this->definition->save($this->workflow); $this->execution->workflow = $this->workflow; $this->execution->start(); $this->assertEquals($this->readExpected('WorkflowWithSubWorkflowAndVariablePassing'), $this->readActual()); }
<?php // Set up workflow definition storage (XML). $definition = new ezcWorkflowDefinitionStorageXml('/path/to/directory'); // Load latest version of workflow named "Test". $workflow = $definition->loadByName('Test');