• Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/lib/Debugger/Services/TrackingService.php
  • Класс: BitrixBizprocDebuggerServicesTrackingService
  • Вызов: TrackingService::write
public function write(
	$workflowId,
	$type,
	$actionName,
	$executionStatus,
	$executionResult,
	$actionTitle = "",
	$actionNote = "",
	$modifiedBy = 0
): ?int
{
	if (in_array((int)$type, self::DEBUG_TRACK_TYPES, true))
	{
		if (!is_array($actionNote))
		{
			$actionNote = $this->preparePropertyForWritingToTrack($actionNote);
		}

		$actionNote = BitrixMainWebJson::encode($actionNote);
	}

	$id = parent::write(
		$workflowId,
		$type,
		$actionName,
		$executionStatus,
		$executionStatus,
		$actionTitle,
		$actionNote,
		$modifiedBy
	);

	$trackingResult = new CBPTrackingServiceResult();
	$trackingResult->InitFromArray([
		$id => [
			'ID' => $id,
			'WORKFLOW_ID' => $workflowId,
			'TYPE' => $type,
			'ACTION_NAME' => $actionName,
			'ACTION_TITLE' => $actionTitle,
			'ACTION_NOTE' => $actionNote,
			'MODIFIED' => (string)(new DateTime()),
		]
	]);

	$result = $trackingResult->fetch();
	Listener::getInstance()->onTrackWrite($result);

	return $id;
}