getParentThreadId( $threadId ); foreach ( $this->state as $oldThreadId ) { if ( $parentThreadId != $execution->getParentThreadId( $oldThreadId ) ) { throw new ezcWorkflowExecutionException( 'Cannot synchronize threads that were started by different branches.' ); } } $this->state[] = $threadId; } /** * Performs the merge by ending the incoming threads and * activating the outgoing node. * * @param ezcWorkflowExecution $execution */ protected function doMerge( ezcWorkflowExecution $execution ) { foreach ( $this->state as $threadId ) { $execution->endThread( $threadId ); } $this->activateNode( $execution, $this->outNodes[0] ); $this->initState(); return parent::execute( $execution ); } /** * Initializes the state of this node. */ protected function initState() { $this->state = array(); } } ?>