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. |
return | integer |
/** * Prepares this node for activation. * * @param ezcWorkflowExecution $execution * @param int $threadId * @throws ezcWorkflowExecutionException */ protected function prepareActivate(ezcWorkflowExecution $execution, $threadId = 0) { $parentThreadId = $execution->getParentThreadId($threadId); if ($this->state['siblings'] == -1) { $this->state['siblings'] = $execution->getNumSiblingThreads($threadId); } else { foreach ($this->state['threads'] as $oldThreadId) { if ($parentThreadId != $execution->getParentThreadId($oldThreadId)) { throw new ezcWorkflowExecutionException('Cannot synchronize threads that were started by different branches.'); } } } $this->state['threads'][] = $threadId; }