• Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/lib/automation/engine/templatestunnel.php
  • Класс: BitrixBizprocAutomationEngineTemplatesTunnel
  • Вызов: TemplatesTunnel::__construct
public function __construct(Template $srcTemplate, Template $dstTemplate)
{
	$this->srcTemplate = $srcTemplate;
	$this->dstTemplate = $dstTemplate;

	if (
		$srcTemplate->getDocumentType() === $dstTemplate->getDocumentType()
		&& $srcTemplate->getDocumentStatus() === $dstTemplate->getDocumentStatus()
	)
	{
		$this->dstTemplate = $this->srcTemplate;
	}

	$documentService = CBPRuntime::getRuntime()->getDocumentService();
	$dstTarget = $documentService->createAutomationTarget($this->dstTemplate->getDocumentType());

	foreach ($dstTarget->getAvailableTriggers() as $triggerDescription)
	{
		if (is_string($triggerDescription['CODE'] ?? null) && $triggerDescription['CODE'] !== '')
		{
			$this->availableTriggers[$triggerDescription['CODE']] = $triggerDescription;
		}
	}
}