* @package oat\tao\model\actionQueue */ abstract class AbstractQueuedAction extends AbstractAction implements QueuedAction { use LoggerAwareTrait; /** * Action execution result * @var mixed */ protected $result; /** * Whether result has been set or not * @var boolean */ protected $resultWasSet = false; /** * @inheritdoc */ abstract public function getNumberOfActiveActions(); /** * Get action identifier * @return string */ final public function getId() { return static::class; } /** * Return result of action execution * @return mixed * @throws ActionQueueException */ public function getResult() { if (!$this->resultWasSet) { throw new ActionQueueException(__('Action was not executed yet')); } return $this->result; } /** * Set result of action * @param mixed $result */ public function setResult($result) { $this->resultWasSet = true; $this->result = $result; } }