• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Service/Operation.php
  • Класс: Bitrix\Crm\Service\Operation
  • Вызов: Operation::runAutomation
protected function runAutomation(): Result
{
	$starter = new Starter($this->item->getEntityTypeId(), $this->item->getId());

	switch ($this->getContext()->getScope())
	{
		case Context::SCOPE_AUTOMATION:
			$starter->setContextToBizproc();
			break;
		case Context::SCOPE_REST:
			$starter->setContextToRest();
			break;
		default:
			$starter->setUserId($this->getContext()->getUserId());
			break;
	}

	return (new Result())->setData(['starter' => $starter]);
}