CBPRuntime::makeRestRobotDescription

  1. Bitrix24 API (v. 23.675.0)
  2. bizproc
  3. CBPRuntime
  4. makeRestRobotDescription
  • Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/classes/general/runtime.php
  • Класс: CBPRuntime
  • Вызов: CBPRuntime::makeRestRobotDescription
private function makeRestRobotDescription($activity, $lang = false, $documentType = null)
{
	if ($lang === false)
		$lang = LANGUAGE_ID;

	$code = static::REST_ACTIVITY_PREFIX.$activity['INTERNAL_CODE'];
	$result = array(
		'NAME' => '['.RestActivityTable::getLocalization($activity['APP_NAME'], $lang).'] '
			.RestActivityTable::getLocalization($activity['NAME'], $lang),
		'DESCRIPTION' => RestActivityTable::getLocalization($activity['DESCRIPTION'], $lang),
		'TYPE' => array('activity', 'robot_activity'),
		'CLASS' => $code,
		'JSCLASS' => 'BizProcActivity',
		'CATEGORY' => [
			'ID' => 'rest',
		],
		'RETURN' => array(),
		//compatibility
		'PATH_TO_ACTIVITY' => '',
		'ROBOT_SETTINGS' => array(
			'CATEGORY' => 'other'
		)
	);

	if (
		isset($activity['FILTER']) && is_array($activity['FILTER'])
		&& !$this->checkActivityFilter($activity['FILTER'], $documentType)
	)
		$result['EXCLUDED'] = true;

	if (!empty($activity['RETURN_PROPERTIES']))
	{
		foreach ($activity['RETURN_PROPERTIES'] as $name => $property)
		{
			$result['RETURN'][$name] = [
				'NAME' => RestActivityTable::getLocalization($property['NAME'], $lang),
				'TYPE' => $property['TYPE'] ?? BitrixBizprocFieldType::STRING,
				'OPTIONS' => $property['OPTIONS'] ?? null,
			];
		}
	}
	if ($activity['USE_SUBSCRIPTION'] !== 'N')
	{
		$result['RETURN']['IsTimeout'] = array(
			'NAME' => GetMessage('BPRA_IS_TIMEOUT'),
			'TYPE' => BitrixBizprocFieldType::INT
		);
	}

	return $result;
}

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