PHP 클래스 ezcWorkflowNodeAction, Workflow
When the node is reached during execution of the workflow, the business logic that is implemented
by the associated service object is executed.
Service objects can return true to resume execution of the
workflow or false to suspend the workflow (unless there are other active nodes)
and be re-executed later
Incoming nodes: 1
Outgoing nodes: 1
The following example displays how to create a workflow with a very
simple service object that prints the argument it was given to the
constructor:
whatToSay = $whatToSay;
}
public function execute( ezcWorkflowExecution $execution )
{
print $this->whatToSay;
return true; // we're finished, activate next node
}
public function __toString()
{
return 'action description';
}
}
$workflow = new ezcWorkflow( 'Test' );
$action = new ezcWorkflowNodeAction( array( "class" => "MyPrintAction",
"arguments" => "No. 1 The larch!" ) );
$action->addOutNode( $workflow->endNode );
$workflow->startNode->addOutNode( $action );
?>
파일 보기
프로젝트 열기: zetacomponents/workflow
1 사용 예제들
공개 메소드들
메소드 |
설명 |
|
__construct ( mixed $configuration ) |
Constructs a new action node with the configuration $configuration. |
|
__toString ( ) : string |
Returns a textual representation of this node. |
|
configurationFromXML ( DOMElement $element ) : array |
Generate node configuration from XML representation. |
|
configurationToXML ( DOMElement $element ) |
Generate XML representation of this node's configuration. |
|
execute ( ezcWorkflowExecution $execution ) : boolean |
Executes this node by creating the service object and calling its execute() method. |
|
보호된 메소드들
메소드 |
설명 |
|
createObject ( ) : ezcWorkflowServiceObject |
Returns the service object as specified by the configuration. |
|
메소드 상세
Configuration format
-
String:
The class name of the service object. Must implement ezcWorkflowServiceObject. No
arguments are passed to the constructor.
-
Array:
- class: The class name of the service object. Must implement ezcWorkflowServiceObject.
- arguments: Array of values that are passed to the constructor of the service object.
-
Returns a textual representation of this node.
configurationFromXML()
공개 정적인 메소드
Generate node configuration from XML representation.
configurationToXML()
공개 메소드
Generate XML representation of this node's configuration.
Returns the service object as specified by the configuration.
protected createObject ( ) : ezcWorkflowServiceObject |
리턴 |
ezcWorkflowServiceObject |
|
If the service object returns true, the output node will be activated.
If the service node returns false the workflow will be suspended
unless there are other activated nodes. An action node suspended this way
will be executed again the next time the workflow is resumed.
public execute ( ezcWorkflowExecution $execution ) : boolean |
$execution |
ezcWorkflowExecution |
|
리턴 |
boolean |
true when the node finished execution,
and false otherwise |