ezcWorkflowExecution::endThread PHP Method

endThread() public method

Ends the thread with id $threadId
public endThread ( integer $threadId )
$threadId integer
    public function endThread($threadId)
    {
        if (isset($this->threads[$threadId])) {
            unset($this->threads[$threadId]);
            foreach ($this->plugins as $plugin) {
                $plugin->afterThreadEnded($this, $threadId);
            }
        } else {
            throw new ezcWorkflowExecutionException(sprintf('There is no thread with id #%d.', $threadId));
        }
    }

Usage Example

Esempio n. 1
0
 /**
  * Performs the merge by ending the incoming threads and
  * activating the outgoing node.
  *
  * @param ezcWorkflowExecution $execution
  * @return boolean true when the node finished execution,
  *                 and false otherwise
  */
 protected function doMerge(ezcWorkflowExecution $execution)
 {
     foreach ($this->state['threads'] as $threadId) {
         $execution->endThread($threadId);
     }
     $this->activateNode($execution, $this->outNodes[0]);
     $this->initState();
     return parent::execute($execution);
 }