CBPRuntime::sendExternalEvent

  1. Bitrix24 API (v. 23.675.0)
  2. bizproc
  3. CBPRuntime
  4. sendExternalEvent
  • Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/classes/general/runtime.php
  • Класс: CBPRuntime
  • Вызов: CBPRuntime::sendExternalEvent
static function sendExternalEvent($workflowId, $eventName, $arEventParameters = array())
{
	$runtime = CBPRuntime::GetRuntime();
	$workflow = $runtime->GetWorkflow($workflowId);
	if ($workflow)
	{
		//check if state exists
		$stateExists = CBPStateService::exists($workflowId);
		$documentExists = false;

		if ($stateExists)
		{
			$documentService = $runtime->getDocumentService();
			$documentExists = $documentService->isDocumentExists($workflow->getDocumentId());
		}

		if (!$stateExists || !$documentExists)
		{
			$workflow->Terminate();

			return false;
		}

		$workflow->SendExternalEvent($eventName, $arEventParameters);
	}
}

Добавить комментарий