• Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/lib/integration/rest/appconfiguration.php
  • Класс: BitrixBizprocIntegrationRestAppConfiguration
  • Вызов: AppConfiguration::exportScript
static function exportScript($step, $nextId, $docType)
{
	$result = [
		'FILE_NAME' => '',
		'CONTENT' => [],
		'NEXT' => false,
	];

	$nextId = (int)$nextId;

	$filter = [
		'>ID' => $nextId,
		'=MODULE_ID' => static::$accessModules,
	];

	if ($docType)
	{
		$filter['=DOCUMENT_TYPE'] = $docType;
	}

	$res = ScriptTable::getList(
		[
			'order' => [
				'ID' => 'ASC',
			],
			'filter' => $filter,
			'limit' => 1,
			'select' => ['ID'],
		]
	);
	if ($tpl = $res->fetch())
	{
		$data = ScriptManager::exportScript($tpl['ID']);
		if ($data)
		{
			$result['NEXT'] = $tpl['ID'];
			$result['FILE_NAME'] = $step;
			$result['CONTENT'] = $data;
		}
	}

	return $result;
}