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));
}
}