Creates new TaskInterface object from parsed crontab line
@param TaskInterface $task_class
@param array $matches
@param string $comment
@return TaskInterface
430447
private static function createTaskWithCrontabLine($task_class, $matches, $comment)
    {
        $task = $task_class::createNew();
        $task->setTime(trim($matches[2]));
        $arguments = str_replace(' ', ',', trim($matches[5]));
        $command = ucfirst($matches[3]) . '::' . $matches[4] . '(' . $arguments . ')';
        $task->setCommand($command);
        if (!empty($comment)) {
            $task->setComment($comment);
        }
        //$output = $matches[7];
        $status = empty($matches[1]) ? TaskInterface::TASK_STATUS_ACTIVE : TaskInterface::TASK_STATUS_INACTIVE;
        $task->setStatus($status);
        $task->setTs(date('Y-m-d H:i:s'));
        $task->taskSave();
        return $task;
    }
1168475
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->options = $input->getOptions();
        $this->arguments = $input->getArguments();
        /** @var \SplFileInfo[] $tasks */
        $tasks = $this->taskCollection
            ->all($this->arguments['source']);

        if (!\count($tasks)) {
            $output->writeln('<comment>No task found!</comment>');

            return 0;
        }

        $table = new Table($output);
        $table->setHeaders(
            [
                '#',
                'Task',
                'Expression',
                'Command to Run',
            ]
        );
        $row = 0;

        foreach ($tasks as $taskFile) {
            $schedule = require $taskFile->getRealPath();
            if (!$schedule instanceof Schedule) {
                throw WrongTaskInstanceException::fromFilePath($taskFile, $schedule);
                continue;
            }

            $events = $schedule->events();
            foreach ($events as $event) {
                $table->addRow(
                    [
                        ++$row,
                        $event->description,
                        $event->getExpression(),
                        $event->getCommandForDisplay(),
                    ]
                );
            }
        }

        $table->render();

        return 0;
    }
264937
function resetTaskRule($taskName, $taskRule)
    {
        $table = TableManager::getInstance()->get(self::$__swooleTableName);
        if ($table->exist($taskName)) {
            if (CronExpression::isValidExpression($taskRule)) {
                $table->set($taskName, ['taskRule' => $taskRule]);
            } else {
                throw new CronTaskRuleInvalid($taskName, $taskRule);
            }
        } else {
            throw new CronTaskNotExist($taskName);
        }
    }
122462
protected function loadCronBatch(\Gems_Task_TaskRunnerBatch $batch)
    {
       $batch->addMessage(sprintf($this->_("Starting %s mail jobs"), $this->project->getName()));
       $batch->addTask('Mail\\AddAllMailJobsTask');

        // Check for unprocessed tokens, 
       $tracker = $this->loader->getTracker();
       $tracker->loadCompletedTokensBatch($batch, null, $this->currentUser->getUserId());
   }
294362
function cancelSubmission($submissionTicket, $comment = NULL) {
		if ($comment == NULL) {
			$cancelSubmissionRequest = new cancelSubmission ();
			$cancelSubmissionRequest->submissionId = $submissionTicket;
			return $this->submissionService->cancelSubmission ( $cancelSubmissionRequest )->return;
		} else {
			$cancelSubmissionRequest = new cancelSubmissionWithComment ();
			$cancelSubmissionRequest->comment = $comment;
			$cancelSubmissionRequest->submissionId = $submissionTicket;
			return $this->submissionService->cancelSubmissionWithComment ( $cancelSubmissionRequest )->return;
		}
	}
658040
public synchronized Task obtainNewReduceTask(TaskTrackerStatus tts,
                                               int clusterSize,
                                               int numUniqueHosts
                                              ) throws IOException {
    if (status.getRunState() != JobStatus.RUNNING) {
      LOG.info("Cannot create task split for " + profile.getJobID());
      return null;
    }

    // Ensure we have sufficient map outputs ready to shuffle before
    // scheduling reduces
    if (!scheduleReduces()) {
      return null;
    }

    int  target = findNewReduceTask(tts, clusterSize, numUniqueHosts);
    if (target == -1) {
      return null;
    }

    Task result = reduces[target].getTaskToRun(tts.getTrackerName());
    if (result != null) {
      addRunningTaskToTIP(reduces[target], result.getTaskID(), tts, true);
    }

    return result;
  }
855355
public function create($name, $jobId, $settings, $period)
    {
        $task = new Task();
        $task->setName($name)
            ->setJobId($jobId)
            ->setSettings($settings)
            ->setPeriod($period);

        $this->om->persist($task);
        $this->om->flush();

        $this->notify(NotifierInterface::MESSAGE_CREATE);

        return $task;
    }
178911
def save_task_comment(self, task_id, task_comment):
        
        magic = self._magic_json(
            action=TouchWorksMagicConstants.ACTION_SAVE_TASK_COMMENT,
            parameter1=task_id,
            parameter6=task_comment)

        response = self._http_request(TouchWorksEndPoints.MAGIC_JSON, data=magic)
        result = self._get_results_or_raise_if_magic_invalid(
            magic,
            response,
            TouchWorksMagicConstants.RESULT_SAVE_TASK_COMMENT)
        return result
849388
public function reply($comment)
    {
        $parameter = new ClientValueObject();
        $parameter->setProperty("Comment",$comment);
        $qry = new InvokePostMethodQuery($this->getResourcePath(),"Reply",null,$parameter);
        $this->getContext()->addQuery($qry);
    }
850943
public function show(string $comment, array $params = [])
    {
        $path = $this->buildCommentsPath($comment);

        return $this->get($path, $params);
    }
642875
protected BAMTaskSummaryImpl createOrUpdateTask(TaskEvent event, Status newStatus) {
        return updateTask(event, newStatus, null);
    }
370767
public static function create(array $properties, string $tasklist = null)
    {
        $task = new static();

        $task->tasklist = static::getGoogleTasks($tasklist)->getTaskId();

        foreach ($properties as $name => $value) {
            $task->$name = $value;
        }

        return $task->save();
    }
1291115
protected long createTaskInternal(final String name, final String channel, final String data, final String key1, final String key2, final Long batchId, int postponeSec, TedStatus status) {
		final String sqlLogId = "create_task";
		if (status == null)
			status = TedStatus.NEW;
		String nextts = (status == TedStatus.NEW ? dbType.sql.now() + " + " + dbType.sql.intervalSeconds(postponeSec) : "null");

		String sql = " insert into tedtask (taskId, `system`, name, channel, bno, status, createTs, nextTs, retries, data, key1, key2, batchId)" +
				" values(null, '$sys', ?, ?, null, '$status', $now, $nextts, 0, ?, ?, ?, ?)" +
				" ";
		sql = sql.replace("$nextTaskId", dbType.sql.sequenceSql("SEQ_TEDTASK_ID"));
		sql = sql.replace("$now", dbType.sql.now());
		sql = sql.replace("$sys", thisSystem);
		sql = sql.replace("$nextts", nextts);
		sql = sql.replace("$status", status.toString());

		final String finalSql = sql;
		Long taskId = JdbcSelectTed.runInConn(dataSource, new ExecInConn<Long>() {
			@Override
			public Long execute(Connection connection) throws SQLException {
				int res = JdbcSelectTedImpl.executeUpdate(connection, finalSql, asList(
						sqlParam(name, JetJdbcParamType.STRING),
						sqlParam(channel, JetJdbcParamType.STRING),
						sqlParam(data, JetJdbcParamType.STRING),
						sqlParam(key1, JetJdbcParamType.STRING),
						sqlParam(key2, JetJdbcParamType.STRING),
						sqlParam(batchId, JetJdbcParamType.LONG)
				));
				if (res != 1)
					throw new IllegalStateException("expected 1 insert");
				String sql = "select last_insert_id()";
				return JdbcSelectTedImpl.selectSingleLong(connection, sql, Collections.<SqlParam>emptyList());
			}
		});

		logger.trace("Task {} {} created successfully. ", name, taskId);
		return taskId;

	}
1181461
public static function create(array $meets, bool $shouldEndInputHandler, array $fails = null, string $reports = null, int $maximumInvocations = null, int $triggerTimeMilliseconds = null): self
    {
        $event = new self();

        $event->meets                   = $meets;
        $event->shouldEndInputHandler   = $shouldEndInputHandler;
        $event->fails                   = $fails;
        $event->reports                 = $reports;
        $event->maximumInvocations      = $maximumInvocations;
        $event->triggerTimeMilliseconds = $triggerTimeMilliseconds;

        return $event;
    }
1122312
public function getTask($task_name, $only_enabled = true) {
        $args = array (
            'task_name' => $task_name
        );
    
        $sql = 'SELECT majat_name, majat_status, majat_last_run, majat_last_result, majat_frequency, majat_nb_occur, majat_running' .
            ' FROM `##maj_admintasks`' .
            ' WHERE majat_name = :task_name';
        if($only_enabled) {
            $sql .= ' AND majat_status = :status';
            $args['status'] = 'enabled';
        }
    
        $task_array = Database::prepare($sql)->execute($args)->fetchOneRow(\PDO::FETCH_ASSOC);
    
        if($task_array) {
            return $this->loadTaskFromRow($task_array);
        }
    
        return null;
    }
795152
public static function onTask($serv, $task_id, $worker_id, $data) {
		$rs = Plugin::trigger('taskStart', [$task_id, $worker_id, $data]);
		if (is_string($rs)) {
			return $rs;
		}
	}
1089240
public static function nPostWait(string $name, $data, $timeout, $workerID = -1)
    {
        $task = TaskParser::getInstance()->getTask($name);
        $paramClass = $task['Task']->paramClass;
        return static::nPostWait(new TaskInfo(new $task['className'], new $paramClass($data)), $timeout, $workerID);
    }