• Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/lib/integration/rest/appconfiguration.php
  • Класс: BitrixBizprocIntegrationRestAppConfiguration
  • Вызов: AppConfiguration::onEventExportController
static function onEventExportController(Event $event)
{
	$result = null;
	$code = $event->getParameter('CODE');
	$itemCode = $event->getParameter('ITEM_CODE');
	if (!static::$entityList[$code])
	{
		return $result;
	}

	$option = $event->getParameters();
	if ($code !== self::ENTITY_BIZPROC_SCRIPT && !Helper::checkAccessManifest($option, static::$accessManifest))
	{
		return $result;
	}

	if (
		$code === self::ENTITY_BIZPROC_SCRIPT
		&& !Helper::checkAccessManifest($option, ['bizproc_script'])
	)
	{
		return $result;
	}

	try
	{
		if (static::checkRequiredParams($code))
		{
			$step = $event->getParameter('STEP');
			switch ($code)
			{
				case self::ENTITY_BIZPROC_MAIN:
					$result = static::exportBizproc($step);
					break;
				case self::ENTITY_BIZPROC_CRM_TRIGGER:
					$result = static::exportCrmTrigger($step);
					break;
				case self::ENTITY_BIZPROC_SCRIPT:
					$result = static::exportScript($step, $event->getParameter('NEXT'), $itemCode);
					break;
			}
		}
	}
	catch (Exception $e)
	{
		$result['NEXT'] = false;
		$result['ERROR_ACTION'] = $e->getMessage();
		$result['ERROR_MESSAGES'] = Loc::getMessage(
			'BIZPROC_ERROR_CONFIGURATION_EXPORT_EXCEPTION',
			[
				'#CODE#' => $code,
			]
		);
	}

	return $result;
}