ezcWorkflowExecution::end PHP Method

end() public method

End nodes must call this method to end the execution.
public end ( ezcWorkflowNode $node = null )
$node ezcWorkflowNode
    public function end(ezcWorkflowNode $node = null)
    {
        if (!$this->cancelled) {
            if ($node !== null) {
                foreach ($this->plugins as $plugin) {
                    $plugin->afterNodeExecuted($this, $node);
                }
            }
            $this->ended = true;
            $this->resumed = false;
            $this->suspended = false;
            $this->doEnd();
            $this->saveToVariableHandlers();
            if ($node !== null) {
                $this->endThread($node->getThreadId());
                foreach ($this->plugins as $plugin) {
                    $plugin->afterExecutionEnded($this);
                }
            }
        } else {
            foreach ($this->plugins as $plugin) {
                $plugin->afterExecutionCancelled($this);
            }
        }
    }

Usage Example

Esempio n. 1
0
 /**
  * Ends the execution of this workflow.
  *
  * @param ezcWorkflowExecution $execution
  * @return boolean true when the node finished execution,
  *                 and false otherwise
  * @ignore
  */
 public function execute(ezcWorkflowExecution $execution)
 {
     $execution->end($this);
     return parent::execute($execution);
 }