• Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/lib/controller/debugger.php
  • Класс: BitrixBizprocControllerDebugger
  • Вызов: Debugger::emulateExternalEventAction
public function emulateExternalEventAction(string $workflowId, string $eventId): ?bool
{
	$session = $this->getSession();

	if (!$session)
	{
		return null;
	}

	if (!$session->hasWorkflow($workflowId) || !WorkflowInstanceTable::exists($workflowId))
	{
		$this->addError(new Error(Loc::getMessage('BIZPROC_CONTROLLER_DEBUGGER_NO_WORKFLOW')));

		return null;
	}

	$runtime = CBPRuntime::GetRuntime(true);
	$workflow = $runtime->getWorkflow($workflowId);

	if (!($workflow instanceof DebugWorkflow))
	{
		$this->addError(new Error(Loc::getMessage('BIZPROC_CONTROLLER_DEBUGGER_NO_WORKFLOW')));

		return null;
	}

	$workflow->sendDebugEvent($eventId);

	return true;
}