PHP 클래스 ezcWorkflowExecution, Workflow

ezcWorkflowExecution provides all functionality necessary to execute a workflow. However, it does not provide functionality to make the execution of a workflow persistent and hence usuable over more than one PHP run. Implementations must implement the do* methods and provide the means to store the execution data to a persistent medium.
파일 보기 프로젝트 열기: zetacomponents/workflow 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$activatedNodes ezcWorkflowNode[] Nodes of the workflow being executed that are activated.
$cancelled boolean Flag that indicates whether or not this execution has been cancelled.
$ended boolean Flag that indicates whether or not this execution has ended.
$id integer Execution ID.
$nextThreadId integer Sequence for thread ids.
$numActivatedEndNodes integer Number of activated end nodes.
$numActivatedNodes integer Number of activated nodes.
$plugins array Plugins registered for this execution.
$properties array(string=>mixed) Container to hold the properties
$resumed boolean Flag that indicates whether or not this execution has been resumed.
$suspended boolean Flag that indicates whether or not this execution has been suspended.
$threads array Nodes of the workflow that started a new thread of execution.
$variables array Workflow variables.
$waitingFor array Workflow variables the execution is waiting for.

공개 메소드들

메소드 설명
__get ( string $propertyName ) : mixed Property read access.
__isset ( string $propertyName ) : boolean Property isset access.
__set ( string $propertyName, mixed $val ) Property write access.
activate ( ezcWorkflowNode $node, boolean $notifyPlugins = true ) : boolean Activates a node and returns true if it was activated, false if not.
addListener ( ezcWorkflowExecutionListener $listener ) : boolean Adds a listener to this execution.
addPlugin ( ezcWorkflowExecutionPlugin $plugin ) : boolean Adds a plugin to this execution.
addWaitingFor ( ezcWorkflowNode $node, string $variableName, ezcWorkflowCondition $condition ) Adds a variable that an (input) node is waiting for.
cancel ( ezcWorkflowNode $node = null ) Cancels workflow execution with the node $endNode.
end ( ezcWorkflowNode $node = null ) Ends workflow execution with the node $endNode.
endThread ( integer $threadId ) Ends the thread with id $threadId
getActivatedNodes ( ) : array Returns the activated nodes.
getId ( ) : integer Returns the execution ID.
getNumSiblingThreads ( integer $threadId ) : integer Returns the number of siblings for a given thread.
getParentThreadId ( integer $threadId ) : integer Returns the id of the parent thread for a given thread.
getSubExecution ( integer $id = null, boolean $interactive = true ) : ezcWorkflowExecution Returns a new execution object for a sub workflow.
getVariable ( string $variableName ) Returns a variable.
getVariables ( ) : array Returns the variables.
getWaitingFor ( ) : array Returns the variables that (input) nodes are waiting for.
hasEnded ( ) : boolean Returns true when the workflow execution has ended.
hasVariable ( string $variableName ) : boolean Checks whether or not a workflow variable has been set.
isCancelled ( ) : boolean Returns true when the workflow execution has been cancelled.
isResumed ( ) : boolean Returns true when the workflow execution has been resumed.
isSuspended ( ) : boolean Returns true when the workflow execution has been suspended.
removeListener ( ezcWorkflowExecutionListener $listener ) : boolean Removes a listener from this execution.
removePlugin ( ezcWorkflowExecutionPlugin $plugin ) : boolean Removes a plugin from this execution.
resume ( array $inputData = [] ) Resumes workflow execution of a suspended workflow.
setVariable ( string $variableName, mixed $value ) : mixed Sets a variable.
setVariables ( array $variables ) Sets the variables.
start ( integer $parentId = null ) : mixed Starts the execution of the workflow and returns the execution id.
startThread ( integer $parentId = null, integer $numSiblings = 1 ) : integer Start a new thread and returns the id of the new thread.
suspend ( ) Suspends workflow execution.
unsetVariable ( string $variableName ) : true, Unsets a variable.

보호된 메소드들

메소드 설명
doEnd ( ) Called by end() when workflow execution is ended.
doGetSubExecution ( integer $id = null ) : ezcWorkflowExecution Returns a new execution object for a sub workflow.
doResume ( ) Called by resume() when workflow execution is resumed.
doStart ( integer $parentId ) Called by start() when workflow execution is initiated.
doSuspend ( ) Called by suspend() when workflow execution is suspended.
execute ( ) The workflow engine's main execution loop. It is started by start() and resume().
loadFromVariableHandlers ( ) Loads data from variable handlers and merge it with the current execution data.
saveToVariableHandlers ( ) Saves data to execution data handlers.

메소드 상세

__get() 공개 메소드

Property read access.
public __get ( string $propertyName ) : mixed
$propertyName string Name of the property.
리턴 mixed Value of the property or null.

__isset() 공개 메소드

Property isset access.
public __isset ( string $propertyName ) : boolean
$propertyName string Name of the property.
리턴 boolean True is the property is set, otherwise false.

__set() 공개 메소드

Property write access.
public __set ( string $propertyName, mixed $val )
$propertyName string Name of the property.
$val mixed The value for the property.

activate() 공개 메소드

The node will only be activated if the node is executable. See {@link ezcWorkflowNode::isExecutable()}.
public activate ( ezcWorkflowNode $node, boolean $notifyPlugins = true ) : boolean
$node ezcWorkflowNode
$notifyPlugins boolean
리턴 boolean

addListener() 공개 메소드

Adds a listener to this execution.
public addListener ( ezcWorkflowExecutionListener $listener ) : boolean
$listener ezcWorkflowExecutionListener
리턴 boolean true when the listener was added, false otherwise.

addPlugin() 공개 메소드

Adds a plugin to this execution.
public addPlugin ( ezcWorkflowExecutionPlugin $plugin ) : boolean
$plugin ezcWorkflowExecutionPlugin
리턴 boolean true when the plugin was added, false otherwise.

addWaitingFor() 공개 메소드

Adds a variable that an (input) node is waiting for.
public addWaitingFor ( ezcWorkflowNode $node, string $variableName, ezcWorkflowCondition $condition )
$node ezcWorkflowNode
$variableName string
$condition ezcWorkflowCondition

cancel() 공개 메소드

Cancels workflow execution with the node $endNode.
public cancel ( ezcWorkflowNode $node = null )
$node ezcWorkflowNode

doEnd() 추상적인 보호된 메소드

Reimplementations can use this method to remove execution data from the persistent medium.
abstract protected doEnd ( )

doGetSubExecution() 추상적인 보호된 메소드

Called by getSubExecution to get a new execution environment for the new execution thread. Reimplementations must return a new execution environment similar to themselves.
abstract protected doGetSubExecution ( integer $id = null ) : ezcWorkflowExecution
$id integer
리턴 ezcWorkflowExecution

doResume() 추상적인 보호된 메소드

Reimplementations can use this method to fetch execution data if necessary..
abstract protected doResume ( )

doStart() 추상적인 보호된 메소드

Reimplementations can use this method to store workflow information to a persistent medium when execution is started.
abstract protected doStart ( integer $parentId )
$parentId integer

doSuspend() 추상적인 보호된 메소드

Reimplementations can use this method to variable and node information to a persistent medium.
abstract protected doSuspend ( )

end() 공개 메소드

End nodes must call this method to end the execution.
public end ( ezcWorkflowNode $node = null )
$node ezcWorkflowNode

endThread() 공개 메소드

Ends the thread with id $threadId
public endThread ( integer $threadId )
$threadId integer

execute() 보호된 메소드

The workflow engine's main execution loop. It is started by start() and resume().
protected execute ( )

getActivatedNodes() 공개 메소드

Returns the activated nodes.
public getActivatedNodes ( ) : array
리턴 array

getId() 공개 메소드

Returns the execution ID.
public getId ( ) : integer
리턴 integer

getNumSiblingThreads() 공개 메소드

Returns the number of siblings for a given thread.
public getNumSiblingThreads ( integer $threadId ) : integer
$threadId integer The id of the thread for which to return the number of siblings.
리턴 integer

getParentThreadId() 공개 메소드

Returns the id of the parent thread for a given thread.
public getParentThreadId ( integer $threadId ) : integer
$threadId integer The id of the thread for which to return the parent thread id.
리턴 integer

getSubExecution() 공개 메소드

If this method is used to resume a subworkflow you must provide the execution id through $id. If $interactive is false an ezcWorkflowExecutionNonInteractive will be returned. This method can be used by nodes implementing sub-workflows to get a new execution environment for the subworkflow.
public getSubExecution ( integer $id = null, boolean $interactive = true ) : ezcWorkflowExecution
$id integer
$interactive boolean
리턴 ezcWorkflowExecution

getVariable() 공개 메소드

Returns a variable.
public getVariable ( string $variableName )
$variableName string

getVariables() 공개 메소드

Returns the variables.
public getVariables ( ) : array
리턴 array

getWaitingFor() 공개 메소드

Returns the variables that (input) nodes are waiting for.
public getWaitingFor ( ) : array
리턴 array

hasEnded() 공개 메소드

Returns true when the workflow execution has ended.
public hasEnded ( ) : boolean
리턴 boolean

hasVariable() 공개 메소드

Checks whether or not a workflow variable has been set.
public hasVariable ( string $variableName ) : boolean
$variableName string
리턴 boolean true when the variable exists and false otherwise.

isCancelled() 공개 메소드

Returns true when the workflow execution has been cancelled.
public isCancelled ( ) : boolean
리턴 boolean

isResumed() 공개 메소드

Returns true when the workflow execution has been resumed.
public isResumed ( ) : boolean
리턴 boolean

isSuspended() 공개 메소드

Returns true when the workflow execution has been suspended.
public isSuspended ( ) : boolean
리턴 boolean

loadFromVariableHandlers() 보호된 메소드

Loads data from variable handlers and merge it with the current execution data.
protected loadFromVariableHandlers ( )

removeListener() 공개 메소드

Removes a listener from this execution.
public removeListener ( ezcWorkflowExecutionListener $listener ) : boolean
$listener ezcWorkflowExecutionListener
리턴 boolean true when the listener was removed, false otherwise.

removePlugin() 공개 메소드

Removes a plugin from this execution.
public removePlugin ( ezcWorkflowExecutionPlugin $plugin ) : boolean
$plugin ezcWorkflowExecutionPlugin
리턴 boolean true when the plugin was removed, false otherwise.

resume() 공개 메소드

$executionId is the id of the execution to resume. $inputData is an associative array of the format array( 'variable name' => value ) that should contain new workflow variable data required to resume execution. Calls do doResume() before the variables are loaded using the variable handlers.
public resume ( array $inputData = [] )
$inputData array The new input data.

saveToVariableHandlers() 보호된 메소드

Saves data to execution data handlers.
protected saveToVariableHandlers ( )

setVariable() 공개 메소드

Sets a variable.
public setVariable ( string $variableName, mixed $value ) : mixed
$variableName string
$value mixed
리턴 mixed the value that the variable has been set to

setVariables() 공개 메소드

Sets the variables.
public setVariables ( array $variables )
$variables array

start() 공개 메소드

$parentId is used to specify the execution id of the parent workflow when executing subworkflows. It should not be used when manually starting workflows. Calls doStart() right before the first node is activated.
public start ( integer $parentId = null ) : mixed
$parentId integer
리턴 mixed Execution ID if the workflow has been suspended, null otherwise.

startThread() 공개 메소드

Start a new thread and returns the id of the new thread.
public startThread ( integer $parentId = null, integer $numSiblings = 1 ) : integer
$parentId integer The id of the parent thread.
$numSiblings integer The number of threads that are started by the same node.
리턴 integer

suspend() 공개 메소드

This method is usually called by the execution environment when there are no more more activated nodes that can be executed. This is commonly the case with input nodes waiting for input. This method calls doSuspend() before calling saveToVariableHandlers() allowing reimplementations to save variable and node information.
public suspend ( )

unsetVariable() 공개 메소드

Unsets a variable.
public unsetVariable ( string $variableName ) : true,
$variableName string
리턴 true,

프로퍼티 상세

$activatedNodes 보호되어 있는 프로퍼티

Nodes of the workflow being executed that are activated.
protected ezcWorkflowNode[] $activatedNodes
리턴 ezcWorkflowNode[]

$cancelled 보호되어 있는 프로퍼티

Flag that indicates whether or not this execution has been cancelled.
protected bool $cancelled
리턴 boolean

$ended 보호되어 있는 프로퍼티

Flag that indicates whether or not this execution has ended.
protected bool $ended
리턴 boolean

$id 보호되어 있는 프로퍼티

Execution ID.
protected int $id
리턴 integer

$nextThreadId 보호되어 있는 프로퍼티

Sequence for thread ids.
protected int $nextThreadId
리턴 integer

$numActivatedEndNodes 보호되어 있는 프로퍼티

Number of activated end nodes.
protected int $numActivatedEndNodes
리턴 integer

$numActivatedNodes 보호되어 있는 프로퍼티

Number of activated nodes.
protected int $numActivatedNodes
리턴 integer

$plugins 보호되어 있는 프로퍼티

Plugins registered for this execution.
protected array $plugins
리턴 array

$properties 보호되어 있는 프로퍼티

Container to hold the properties
protected array(string=>mixed) $properties
리턴 array(string=>mixed)

$resumed 보호되어 있는 프로퍼티

Flag that indicates whether or not this execution has been resumed.
protected bool $resumed
리턴 boolean

$suspended 보호되어 있는 프로퍼티

Flag that indicates whether or not this execution has been suspended.
protected bool $suspended
리턴 boolean

$threads 보호되어 있는 프로퍼티

Nodes of the workflow that started a new thread of execution.
protected array $threads
리턴 array

$variables 보호되어 있는 프로퍼티

Workflow variables.
protected array $variables
리턴 array

$waitingFor 보호되어 있는 프로퍼티

Workflow variables the execution is waiting for.
protected array $waitingFor
리턴 array