• Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/lib/automation/target/basetarget.php
  • Класс: BitrixBizprocAutomationTargetBaseTarget
  • Вызов: BaseTarget::prepareApplyRules
private function prepareApplyRules($rules, $external = false): ?array
{
	if (!is_array($rules))
	{
		return null;
	}

	if (isset($rules['Condition']))
	{
		$condition = new ConditionGroup($rules['Condition']);
		if ($external)
		{
			$condition->externalizeValues($this->getDocumentType());
		}
		else
		{
			$condition->internalizeValues($this->getDocumentType());
		}
		$rules['Condition'] = $condition->toArray();
	}

	if (isset($rules['ExecuteBy']))
	{
		if ($external)
		{
			$rules['ExecuteBy'] = CBPHelper::UsersArrayToString(
				$rules['ExecuteBy'],
				null,
				$this->getDocumentType()
			);
		}
		else
		{
			$rules['ExecuteBy'] = CBPHelper::UsersStringToArray(
				$rules['ExecuteBy'],
				$this->getDocumentType(),
				$errors
			);
		}
	}

	return $rules;
}