protected function getTask($taskId)
    {
        if (!isset($this->tasks[$taskId])) {
            /** @var Queue $taskQueue */
            $taskQueue = $this->getServiceManager()->get(Queue::SERVICE_ID);
            $task = $taskQueue->getTask($taskId);
            if ($task === null) {
                throw new \common_exception_NotFound(__('Task not found'));
            }
            $this->tasks[$taskId] = $task;
        }
        return $this->tasks[$taskId];
    }