• Модуль: lists
  • Путь к файлу: ~/bitrix/modules/lists/lib/entity/element.php
  • Класс: BitrixListsEntityElement
  • Вызов: Element::hasBpTemplatesWithAutoStart
private function hasBpTemplatesWithAutoStart(int $execType): bool
{
	$documentType = BizProcDocument::generateDocumentComplexType(
		$this->params["IBLOCK_TYPE_ID"],
		$this->iblockId
	);

	$bpTemplatesWithAutoStart = CBPWorkflowTemplateLoader::searchTemplatesByDocumentType(
		$documentType,
		$execType
	);

	foreach ($bpTemplatesWithAutoStart as $template)
	{
		if (!CBPWorkflowTemplateLoader::isConstantsTuned($template["ID"]))
		{
			$this->errorCollection->setError(
				new Error("Workflow constants need to be configured", self::ERROR_ADD_ELEMENT)
			);
		}
	}

	return !empty($bpTemplatesWithAutoStart);
}