Override options for given task

@param string $taskName
@param array $options

@return \TYPO3\Surf\Domain\Model\Workflow
160909
public function setTaskOptions($taskName, $options)
    {
        $baseTask = $taskName;
        if (isset($this->tasks['defined'][$taskName]) && is_array($this->tasks['defined'][$taskName])) {
            $definedTask = $this->tasks['defined'][$taskName];
            $baseTask = $definedTask['task'];
            if (is_array($definedTask['options'])) {
                $options = array_merge_recursive($definedTask['options'], $options);
            }
        }
        $this->defineTask($taskName, $baseTask, $options);

        return $this;
    }
415574
protected function handleJs(string $task, array $options)
    {
        /** @var Collection $collection */
        $collection = $this->assetsManager->collection($task);

        if (isset($options['files'])) {
            foreach ($options['files'] as $file) {
                $collection->addJs($file, true);
            }
        }

        if (isset($options['join'])) {
            $collection->join((bool)$options['join']);
        }
        if (isset($options['filters'])) {
            foreach ($options['filters'] as $filter) {
                $filterObj = new $filter();
                $collection->addFilter($filterObj);
            }
        }
        if (isset($options['target'])) {
            $collection->setTargetPath($options['target']);
        }

        ob_start();
        $this->assetsManager->outputJs($task);
        ob_end_clean();
    }
1277322
public function applyRule($ruleName, $options = '')
    {
        $item = $this->items[$this->currentKey];
        $this->processRule($item, $ruleName, $options);

        return $this;
    }
65262
public static function createFromOptions(array $options)
    {
        Validate::notNull($options['JobTemplateBody'], 'options[JobTemplateBody]');

        $jobTemplate = new self(
            $options['JobTemplateBody'],
            $options['TemplateType']
        );
        $jobTemplate->fromArray($options);

        return $jobTemplate;
    }
766822
protected function execute(InputInterface $input, OutputInterface $output)
    {
        if (!$this->workflowRegistry instanceof Registry) {
            throw new Exception('Can not execute task: No workflows were defined');
        }

        $taskId = $input->getArgument('task-id');

        $callback = function () use ($taskId) {
            $task = $this->entityManager->find(Task::class, $taskId);

            if ($task instanceof Task) {
                $task->setStatus('in-progress');
            }

            return $task;
        };

        $task = $this->entityManager->transactional($callback);

        if (!$task instanceof Task) {
            $output->writeln(sprintf('No task found for id %d', $taskId));

            return;
        }

        $this->setAnonymousToken();

        $subject = $this->subjectManager->createSubject($task->getModel());
        $subject->setUp();
        $generator = $this->generatorManager->getGenerator($task->getGenerator());
        $workflow = $this->workflowRegistry->get($subject, $task->getModel());

        $path = new Path();
        $path->add(null, null, [$workflow->getDefinition()->getInitialPlace()]);

        try {
            foreach ($generator->getAvailableTransitions($workflow, $subject, $task->getMetaData()) as $transitionName) {
                try {
                    if (!$generator->applyTransition($workflow, $subject, $transitionName)) {
                        throw new Exception(sprintf("Generator '%s' generated transition '%s' that can not be applied", $task->getGenerator(), $transitionName));
                    }
                } catch (Throwable $throwable) {
                    throw $throwable;
                } finally {
                    $data = $subject->getStoredData();
                    $places = array_keys(array_filter($workflow->getMarking($subject)->getPlaces()));
                    $path->add($transitionName, $data, $places);
                }
            }
        } catch (Throwable $throwable) {
            $message = new CreateBugMessage(
                $this->defaultBugTitle,
                Path::serialize($path),
                $path->countPlaces(),
                $throwable->getMessage(),
                $task->getId(),
                'new'
            );
            $this->messageBus->dispatch($message);
        } finally {
            $subject->tearDown();

            $this->messageBus->dispatch(new UpdateTaskStatusMessage($taskId, 'completed'));
        }
    }
709462
public function projects($task, $params = array(), $options = array())
    {
        $path = sprintf("/tasks/%s/projects", $task);
        return $this->client->getCollection($path, $params, $options);
    }
15925
public static function createFromOptions(array $options)
    {
        Validate::notNull(
            $options['NumberofInputAssets'],
            'options[NumberofInputAssets]'
        );
        Validate::notNull(
            $options['NumberofOutputAssets'],
            'options[NumberofOutputAssets]'
        );

        $taskTemplate = new self(
            $options['NumberofInputAssets'],
            $options['NumberofOutputAssets']
        );
        $taskTemplate->fromArray($options);

        return $taskTemplate;
    }
960682
public function execute($options = [])
    {
        if (! is_array($options) && ! $options instanceof Option) throw new \InvalidArgumentException('invalid option');
        if (! $this->do) throw new \Samurai\Samurai\Exception\LogicException('preset task something do.');

        $option = $this->getOption($this->do);
        if (is_array($options)) {
            $option->importFromArray($options);
        } else {
            $option->import($options);
        }
        $option->validate();
        $this->{$this->do . 'Task'}($option);
    }
387239
public static function createFromOptions(array $options)
    {
        Validate::notNull($options['TaskBody'], 'options[TaskBody]');
        Validate::notNull($options['Options'], 'options[Options]');
        Validate::notNull($options['MediaProcessorId'], 'options[MediaProcessorId]');

        $task = new self(
            $options['TaskBody'],
            $options['MediaProcessorId'],
            $options['Options']
        );
        $task->fromArray($options);

        return $task;
    }
460317
public function runTaskNow($taskName)
    {
        $tasks = $this->loader->loadTasks();

        foreach ($tasks as $task) {
            if ($task->getName() === $taskName) {
                return $this->executeTask($task);
            }
        }

        throw new \InvalidArgumentException('Task ' . $taskName . ' not found');
    }
301797
protected function handleCss(string $task, array $options)
    {
        /** @var Collection $collection */
        $collection = $this->assetsManager->collection($task);

        if (isset($options['files'])) {
            foreach ($options['files'] as $file) {
                $collection->addCss($file, true);
            }
        }

        if (isset($options['join'])) {
            $collection->join((bool)$options['join']);
        }
        if (isset($options['filters'])) {
            foreach ($options['filters'] as $filter) {
                $filterObj = new $filter();
                $collection->addFilter($filterObj);
            }
        }
        if (isset($options['target'])) {
            $collection->setTargetPath($options['target']);
        }

        ob_start();
        $this->assetsManager->outputCss($task);
        ob_end_clean();
    }
1091464
public function clockpicker($fieldName, array $options = [])
    {
        $defaults = [
            'div' => [
                'class' => 'form-group',
            ],
            'label' => [
                'class' => 'control-label form-control-label',
            ],
            'class' => 'form-control form-control-clockpicker',
            'type' => 'text',
        ];
        $options = Hash::merge($defaults, $options);
        return parent::input($fieldName, $options);
    }
503291
public function queue($name, array $options = [])
    {
        return $this->queues[$name] = (new QueueBuilder($this, $name))->options($options);
    }
292675
public function createQueue($queueName, array $options = [])
    {
        /** @var \Generated\Shared\Transfer\RabbitMqOptionTransfer $rabbitMqOption */
        $rabbitMqOption = $options['rabbitMqConsumerOption'];

        return $this->queueEstablishmentHelper->createQueue($this->channel, $rabbitMqOption);
    }
594454
public function setTaskName(string $taskName = NULL)
	{
		if ($taskName !== NULL && Strings::length($taskName) <= 0) {
			throw new InvalidTaskNameException('Given task name is not valid.');
		}
		$this->taskName = $taskName;
	}
539623
public function options(array $options): self
    {
        foreach ($options as $name => $value) {
            $this->option($name, $value);
        }

        return $this;
    }
867973
public function setOptions(Array $options)
    {
        foreach ($options as $optionName => $optionValue) {
            $this->setTableConfig($optionName, $optionValue);
        }
        return $this;
    }