• Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/lib/automation/engine/runtime.php
  • Класс: BitrixBizprocAutomationEngineRuntime
  • Вызов: Runtime::onDocumentAdd
public function onDocumentAdd(?Context $context = null)
{
	$preGeneratedWorkflowId = CBPRuntime::generateWorkflowId();
	$isManualAdd = $context && $context->isManualOperation();

	if (!$isManualAdd && $this->isDebug(true))
	{
		$debugSession = BizprocDebuggerSessionManager::getActiveSession();

		if ($debugSession->isBeforeDebuggerStartState())
		{
			$debugSession->addDocument($this->getTarget()->getDocumentId());

			return;
		}

		$debugSession->addWorkflowContext($preGeneratedWorkflowId, []);

		$status = $this->getTarget()->getDocumentStatus();
		$this->writeSessionLegendTrack($preGeneratedWorkflowId);
		$this->writeStatusTracking($preGeneratedWorkflowId, $status);
		$this->writeCategoryTracking($preGeneratedWorkflowId);
	}

	$this->runDocumentStatus($preGeneratedWorkflowId);
}