• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/util/process.php
  • Класс: BitrixTasksUtilProcess
  • Вызов: Process::execute
public function execute()
	{
		$execResult = new ExecutionResult();

		$this->onBeforePerformIteration();

		if($this->stage === false)
		{
			throw new SystemException('No more stages to perform');
		}

		$stage = $this->stage;

		if(is_callable(array($this, $stage.'Before')))
		{
			call_user_func(array($this, $stage.'Before'));
		}

		$result = null;
		while($this->checkQuota())
		{
			$result = call_user_func_array(array($this, $stage.'Action'), array($execResult));
			$this->nextStep();

			if($result === true)
			{
				break;
			}
		}

		if($result === true)
		{
			$this->nextStage();
		}

		if(is_callable(array($this, $stage.'After')))
		{
			call_user_func(array($this, $stage.'After'));
		}

		$this->onAfterPerformIteration();
		$percent = $this->getPercent();

		$this->saveMemoryPeak();

		$execResult->setPercent($percent);

		return $execResult;
	}