ezcWorkflowExecution::cancel PHP Method

cancel() public method

Cancels workflow execution with the node $endNode.
public cancel ( ezcWorkflowNode $node = null )
$node ezcWorkflowNode
    public function cancel(ezcWorkflowNode $node = null)
    {
        if ($node !== null) {
            foreach ($this->plugins as $plugin) {
                $plugin->afterNodeExecuted($this, $node);
            }
        }
        $this->activatedNodes = array();
        $this->numActivatedNodes = 0;
        $this->waitingFor = array();
        if (count($this->workflow->finallyNode->getOutNodes()) > 0) {
            $this->workflow->finallyNode->activate($this);
            $this->execute();
        }
        $this->cancelled = true;
        $this->ended = false;
        $this->end($node);
        $this->doEnd();
    }

Usage Example

Esempio n. 1
0
 /**
  * Cancels the execution of this workflow.
  *
  * @param ezcWorkflowExecution $execution
  * @param ezcWorkflowNode      $activatedFrom
  * @param int                  $threadId
  * @ignore
  */
 public function activate(ezcWorkflowExecution $execution, ezcWorkflowNode $activatedFrom = null, $threadId = 0)
 {
     $execution->cancel($this);
 }