Метод upgradeAction
Сигнатура метода
public function upgradeAction(int $templateId, ?array $constantValues = null): array
Возвращает:
array
Описание
Upgrade a launched AI-agent copy to the current reference template version (API-01). The upgrade master is always shown for review before applying (ADR §10.3). The first call omits $constantValues and returns the review payload; the copy is written only on a subsequent submit that carries $constantValues (value-passthrough), and only after the server re-validates the required constants (the UI is not the source of truth). Check order (server-side only): tariff + region -> admin-only rights -> launched-copy ownership/link -> AgentUpgradeService. Response (API-01, NORMATIVE): review (first call / re-validation) -> { status: "needs_review", blocks: [...], // setup blocks of every editable constant of the new version values: { <constantCode>: <value> }, // values to pre-fill the master: current copy values on // the first call, the submitted values (merged over // current) on a re-validation, so user input is kept requiredConstants: [<code>, ...], // required constants still missing a value (may be empty) invalidConstants: [<code>, ...], // submitted values that failed field-type re-validation // (empty on the first call; empty when all are valid) } applied (submit) -> { status: "updated", row: <grid row with DTO-01 fields> } conflict/error -> errors payload (ERR-002/003/005/006), no partial changes. blocks/values are derived from the reference template and the merge, never from the not-yet-written copy.
Параметры
2| Имя | Тип | По умолчанию | Флаги |
|---|---|---|---|
$templateId
|
int
|
—
|
—
|
$constantValues
|
?array
|
null
|
—
|
Расположение
Исходный файл метода в Bitrix Framework
~/bitrix/modulesbizproc/lib/Infrastructure/Controller/Integration/AiAgent/Template.php