PHP Class ezcWorkflowNode, Workflow

All workflow nodes must extend this class.
Inheritance: implements ezcWorkflowVisitable
Afficher le fichier Open project: zetacomponents/workflow Class Usage Examples

Protected Properties

Свойство Type Description
$activatedFrom ezcWorkflowNode[] The node(s) that activated this node.
$activationState integer The state of this node.
$configuration The configuration is a structured (hash) array with the various options of the implemented node. This functionality is implemented as an array to make it possible to have the storage engines unaware of the node classes.
$id integer Only available when the workflow this node belongs to has been loaded from or saved to the data storage.
$inNodes The incoming nodes of this node.
$internalCall boolean Flag that indicates whether an add*Node() or remove*Node() call is internal. This is necessary to avoid unlimited loops.
$maxInNodes integer Constraint: The maximum number of incoming nodes this node has to have to be valid. Set to false to disable this constraint.
$maxOutNodes integer Constraint: The maximum number of outgoing nodes this node has to have to be valid. Set to false to disable this constraint.
$minInNodes integer Constraint: The minimum number of incoming nodes this node has to have to be valid. Set to false to disable this constraint.
$minOutNodes integer Constraint: The minimum number of outgoing nodes this node has to have to be valid. Set to false to disable this constraint.
$numInNodes integer The number of incoming nodes.
$numOutNodes integer The number of outgoing nodes.
$outNodes The outgoing nodes of this node.
$state mixed The state of this node.
$threadId integer The id of the thread this node is executing in.

Méthodes publiques

Méthode Description
__construct ( mixed $configuration = null ) Constructs a new node with the configuration $configuration.
__toString ( ) : string Returns a textual representation of this node.
accept ( ezcWorkflowVisitor $visitor ) Reimplementation of accept() calls accept on all out nodes.
activate ( ezcWorkflowExecution $execution, ezcWorkflowNode $activatedFrom = null, integer $threadId ) Activate this node in the execution environment $execution.
addInNode ( ezcWorkflowNode $node ) : ezcWorkflowNode Adds a node to the incoming nodes of this node.
addOutNode ( ezcWorkflowNode $node ) : ezcWorkflowNode Adds a node to the outgoing nodes of this node.
configurationFromXML ( DOMElement $element ) Generate node configuration from XML representation.
configurationToXML ( DOMElement $element ) Generate XML representation of this node's configuration.
execute ( ezcWorkflowExecution $execution ) : boolean Executes and performs the workflow duties of this node and returns true if the node completed execution.
getActivatedFrom ( ) : array Returns the node(s) that activated this node.
getConfiguration ( ) : mixed Returns the configuration of this node.
getId ( ) : integer Returns the Id of this node.
getInNodes ( ) : ezcWorkflowNode[] Returns the incoming nodes of this node.
getOutNodes ( ) : ezcWorkflowNode[] Returns the outgoing nodes of this node.
getState ( ) : mixed Returns the state of this node.
getThreadId ( ) : integer Returns the id of the thread this node is executing in.
initState ( ) Initializes the state of this node.
isExecutable ( ) : boolean Returns true if this node is ready for execution and false if it is not.
removeInNode ( ezcWorkflowNode $node ) : boolean Removes a node from the incoming nodes of this node.
removeOutNode ( ezcWorkflowNode $node ) : boolean Removes a node from the outgoing nodes of this node.
setActivatedFrom ( array $activatedFrom ) Sets the node(s) that activated this node.
setActivationState ( integer $activationState ) Sets the activation state for this node.
setId ( integer $id ) Sets the Id of this node.
setState ( mixed $state ) Sets the state of this node.
setThreadId ( integer $threadId ) Sets the id of the thread this node is executing in.
verify ( ) Checks this node's constraints.

Méthodes protégées

Méthode Description
activateNode ( ezcWorkflowExecution $execution, ezcWorkflowNode $node ) Convenience method for activating an (outgoing) node.

Method Details

__construct() public méthode

The configuration is a structured (hash) array. Implementations must pass their complete configuration on to this object. We have chosen to use structured arrays for the configuration since it simplifies the process of creating new node types and storing workflows.
public __construct ( mixed $configuration = null )
$configuration mixed

__toString() public méthode

Returns a textual representation of this node.
public __toString ( ) : string
Résultat string

accept() public méthode

Reimplementation of accept() calls accept on all out nodes.
public accept ( ezcWorkflowVisitor $visitor )
$visitor ezcWorkflowVisitor

activate() public méthode

$activatedFrom is the node that activated this node and $threadId is threadId of the thread the node should be activated in. This method is called by other nodes and/or the execution environment depending on the workflow.
public activate ( ezcWorkflowExecution $execution, ezcWorkflowNode $activatedFrom = null, integer $threadId )
$execution ezcWorkflowExecution
$activatedFrom ezcWorkflowNode
$threadId integer

activateNode() protected méthode

Convenience method for activating an (outgoing) node.
protected activateNode ( ezcWorkflowExecution $execution, ezcWorkflowNode $node )
$execution ezcWorkflowExecution
$node ezcWorkflowNode

addInNode() public méthode

Automatically adds $node to the workflow and adds this node as an out node of $node.
public addInNode ( ezcWorkflowNode $node ) : ezcWorkflowNode
$node ezcWorkflowNode The node that is to be added as incoming node.
Résultat ezcWorkflowNode

addOutNode() public méthode

Automatically adds $node to the workflow and adds this node as an in node of $node.
public addOutNode ( ezcWorkflowNode $node ) : ezcWorkflowNode
$node ezcWorkflowNode The node that is to be added as outgoing node.
Résultat ezcWorkflowNode

configurationFromXML() public static méthode

Generate node configuration from XML representation.
public static configurationFromXML ( DOMElement $element )
$element DOMElement

configurationToXML() public méthode

Generate XML representation of this node's configuration.
public configurationToXML ( DOMElement $element )
$element DOMElement

execute() public méthode

Implementations of ezcWorkflowNode should reimplement this method. This method is called automatically by the workflow execution environment and should not be called directly. The default implementation resets the activation state of the node.
public execute ( ezcWorkflowExecution $execution ) : boolean
$execution ezcWorkflowExecution
Résultat boolean true when the node finished execution, and false otherwise

getActivatedFrom() public méthode

Returns the node(s) that activated this node.
public getActivatedFrom ( ) : array
Résultat array

getConfiguration() public méthode

Returns the configuration of this node.
public getConfiguration ( ) : mixed
Résultat mixed

getId() public méthode

Returns the Id of this node.
public getId ( ) : integer
Résultat integer

getInNodes() public méthode

Returns the incoming nodes of this node.
public getInNodes ( ) : ezcWorkflowNode[]
Résultat ezcWorkflowNode[]

getOutNodes() public méthode

Returns the outgoing nodes of this node.
public getOutNodes ( ) : ezcWorkflowNode[]
Résultat ezcWorkflowNode[]

getState() public méthode

Returns the state of this node.
public getState ( ) : mixed
Résultat mixed

getThreadId() public méthode

Returns the id of the thread this node is executing in.
public getThreadId ( ) : integer
Résultat integer

initState() public méthode

Initializes the state of this node.
public initState ( )

isExecutable() public méthode

Returns true if this node is ready for execution and false if it is not.
public isExecutable ( ) : boolean
Résultat boolean

removeInNode() public méthode

Automatically removes $this as an out node of $node.
public removeInNode ( ezcWorkflowNode $node ) : boolean
$node ezcWorkflowNode The node that is to be removed as incoming node.
Résultat boolean

removeOutNode() public méthode

Automatically removes $this as an in node of $node.
public removeOutNode ( ezcWorkflowNode $node ) : boolean
$node ezcWorkflowNode The node that is to be removed as outgoing node.
Résultat boolean

setActivatedFrom() public méthode

Sets the node(s) that activated this node.
public setActivatedFrom ( array $activatedFrom )
$activatedFrom array

setActivationState() public méthode

One of ezcWorkflowNode::WAITING_FOR_ACTIVATION or ezcWorkflowNode::WAITING_FOR_EXECUTION.
public setActivationState ( integer $activationState )
$activationState integer

setId() public méthode

Sets the Id of this node.
public setId ( integer $id )
$id integer

setState() public méthode

Sets the state of this node.
public setState ( mixed $state )
$state mixed

setThreadId() public méthode

Sets the id of the thread this node is executing in.
public setThreadId ( integer $threadId )
$threadId integer

verify() public méthode

The constraints checked are the minimum in nodes maximum in nodes, minimum out nodes and maximum out nodes.
public verify ( )

Property Details

$activatedFrom protected_oe property

The node(s) that activated this node.
protected ezcWorkflowNode[] $activatedFrom
Résultat ezcWorkflowNode[]

$activationState protected_oe property

The state of this node.
protected int $activationState
Résultat integer

$configuration protected_oe property

The configuration is a structured (hash) array with the various options of the implemented node. This functionality is implemented as an array to make it possible to have the storage engines unaware of the node classes.
protected $configuration

$id protected_oe property

Only available when the workflow this node belongs to has been loaded from or saved to the data storage.
protected int $id
Résultat integer

$inNodes protected_oe property

The incoming nodes of this node.
protected $inNodes

$internalCall protected_oe static_oe property

Flag that indicates whether an add*Node() or remove*Node() call is internal. This is necessary to avoid unlimited loops.
protected static bool $internalCall
Résultat boolean

$maxInNodes protected_oe property

Constraint: The maximum number of incoming nodes this node has to have to be valid. Set to false to disable this constraint.
protected int $maxInNodes
Résultat integer

$maxOutNodes protected_oe property

Constraint: The maximum number of outgoing nodes this node has to have to be valid. Set to false to disable this constraint.
protected int $maxOutNodes
Résultat integer

$minInNodes protected_oe property

Constraint: The minimum number of incoming nodes this node has to have to be valid. Set to false to disable this constraint.
protected int $minInNodes
Résultat integer

$minOutNodes protected_oe property

Constraint: The minimum number of outgoing nodes this node has to have to be valid. Set to false to disable this constraint.
protected int $minOutNodes
Résultat integer

$numInNodes protected_oe property

The number of incoming nodes.
protected int $numInNodes
Résultat integer

$numOutNodes protected_oe property

The number of outgoing nodes.
protected int $numOutNodes
Résultat integer

$outNodes protected_oe property

The outgoing nodes of this node.
protected $outNodes

$state protected_oe property

The state of this node.
protected mixed $state
Résultat mixed

$threadId protected_oe property

The id of the thread this node is executing in.
protected int $threadId
Résultat integer