Метод findActiveLaunchedCopyId
Сигнатура метода
public function findActiveLaunchedCopyId(): ?int
Возвращает:
?int
Описание
The id of the active launched copy of the agent, or null when there is none - the check of the invariant, and the identity of the copy for the journal. Mirrors the canonical predicate of the module that owns the template model (Bizproc\Internal\Repository\WorkflowTemplate\AiAgentRepository): a copy (SYSTEM_CODE IS NULL) of the AI-agent kind (TYPE = Nodes, a row in the AI_AGENT section) linked to this system code that has been started (ACTIVATED_AT IS NOT NULL) and is switched on (ACTIVE = 'Y'). The whole criterion is reproduced because the canonical repository lives in the Internal namespace of bizproc: a template that lost its section is not a working copy of the agent for BizProc, so a narrower predicate here would confirm the invariant while the call assessment stays down. Reads without cache on purpose: this predicate decides whether a copy has to be created, and a stale negative answer under the restore lock produces the very duplicate the lock protects from. Staleness of a replica is closed by the lock itself, which keeps the connection on the master while it is held. That is why findLaunchedTemplateId() cannot be reused here - it caches, and its criterion is the link alone.
Расположение
Исходный файл метода в Bitrix Framework
~/bitrix/modulescrm/lib/integration/bizproc/callassessmentaiagent.php