Workflow: ezcWorkflowDefinitionStorageXml
[ ]
[ Theoretical background ]
[ ]
[ ]
[ ]
[ ]
Class: ezcWorkflowDefinitionStorageXml
|
XML workflow definition storage handler. [
source]
Implemented Interfaces
The definitions are stored inside the directory specified to the constructor with the name: [workflowName]_[workflowVersion].xml where the name of the workflow has dots and spaces replaced by '_'.
Member Variables
|
protected string |
$directory
The directory that holds the XML files. |
Method Summary
|
public ezcWorkflowDefinitionStorageXml |
__construct(
[$directory = ''] )
Constructs a new definition loader that loads definitions from $directory. |
|
public static DOMElement |
conditionToXml(
$condition, $document )
"Convert" an ezcWorkflowCondition object into an DOMElement object. |
|
protected integer |
getCurrentVersion(
$workflowName )
Returns the current version number for a given workflow name. |
|
protected string |
getFilename(
$workflowName, $workflowVersion )
Returns the filename with path for given workflow name and version. |
|
protected string |
getFilesystemWorkflowName(
$workflowName )
Returns a safe filesystem name for a given workflow. |
|
public ezcWorkflow |
loadByName(
$workflowName, [$workflowVersion = 0] )
Load a workflow definition from a file. |
|
public ezcWorkflow |
loadFromDocument(
$document )
Load a workflow definition from a DOMDocument. |
|
public void |
save(
$workflow )
Save a workflow definition to a file. |
|
public DOMDocument |
saveToDocument(
$workflow, $workflowVersion )
Save a workflow definition to a DOMDocument. |
|
public static DOMElement |
variableToXml(
$variable, $document )
"Convert" a PHP variable into an DOMElement object. |
|
public static ezcWorkflowCondition |
xmlToCondition(
$element )
"Convert" an DOMElement object into an ezcWorkflowCondition object. |
|
public static mixed |
xmlToVariable(
$element )
"Convert" an DOMElement object into a PHP variable. |
Methods
__construct
ezcWorkflowDefinitionStorageXml __construct(
[string
$directory = ''] )
Constructs a new definition loader that loads definitions from $directory.
$directory must contain the trailing '/'
Parameters
| Name |
Type |
Description |
$directory |
string |
The directory that holds the XML files. |
conditionToXml
"Convert" an ezcWorkflowCondition object into an DOMElement object.
Parameters
getCurrentVersion
integer getCurrentVersion(
string
$workflowName )
Returns the current version number for a given workflow name.
Parameters
| Name |
Type |
Description |
$workflowName |
string |
|
getFilename
string getFilename(
string
$workflowName, int
$workflowVersion )
Returns the filename with path for given workflow name and version.
The name of the workflow file is of the format [workFlowName]_[workFlowVersion].xml
Parameters
| Name |
Type |
Description |
$workflowName |
string |
|
$workflowVersion |
int |
|
getFilesystemWorkflowName
string getFilesystemWorkflowName(
string
$workflowName )
Returns a safe filesystem name for a given workflow.
This method replaces whitespace and '.' with '_'.
Parameters
| Name |
Type |
Description |
$workflowName |
string |
|
loadByName
ezcWorkflow loadByName(
string
$workflowName, [int
$workflowVersion = 0] )
Load a workflow definition from a file.
When the $workflowVersion argument is omitted, the most recent version is loaded.
Parameters
| Name |
Type |
Description |
$workflowName |
string |
|
$workflowVersion |
int |
|
Throws
| Class | Description |
ezcWorkflowDefinitionStorageException |
|
loadFromDocument
Load a workflow definition from a DOMDocument.
Parameters
| Name |
Type |
Description |
$document |
DOMDocument |
|
save
Save a workflow definition to a file.
Parameters
Throws
| Class | Description |
ezcWorkflowDefinitionStorageException |
|
saveToDocument
DOMDocument saveToDocument(
ezcWorkflow
$workflow, int
$workflowVersion )
Save a workflow definition to a DOMDocument.
Parameters
| Name |
Type |
Description |
$workflow |
ezcWorkflow |
|
$workflowVersion |
int |
|
variableToXml
DOMElement variableToXml(
mixed
$variable,
$document )
"Convert" a PHP variable into an DOMElement object.
Parameters
| Name |
Type |
Description |
$variable |
mixed |
|
$document |
DOMDocument |
|
xmlToCondition
"Convert" an DOMElement object into an ezcWorkflowCondition object.
Parameters
| Name |
Type |
Description |
$element |
DOMElement |
|
xmlToVariable
mixed xmlToVariable(
$element )
"Convert" an DOMElement object into a PHP variable.
Parameters
| Name |
Type |
Description |
$element |
DOMElement |
|
Last updated: Mon, 05 Jan 2009