Skip to main content

XpmActions._expandTemplateActions() method

Expands a template action into multiple concrete actions.

Signature

protected _expandTemplateActions({ actionName, jsonActionTemplate, }: {
actionName: string;
jsonActionTemplate: JsonActionTemplate;
}): Promise<Map<string, XpmAction>>;

Parameters

Parameter

Type

Description

{ actionName, jsonActionTemplate, }

{ actionName: string; jsonActionTemplate: JsonActionTemplate; }

Returns

Promise<Map<string, XpmAction>>

A promise that resolves to a map of expanded action names to their corresponding action instances.

Exceptions

XpmError If the matrix structure is invalid, template format is incorrect, or substitution fails.

Remarks

This method computes the Cartesian product of all matrix parameter values and creates a separate action for each combination, substituting matrix values into both the action name and command templates.

Processing steps:

  1. Validates matrix structure (object with array values).
  2. Validates template format (string or array).
  3. Performs Liquid substitutions on matrix values if they contain template syntax.
  4. Recursively generates all combinations using Cartesian product.
  5. Creates an action instance for each combination with matrix parameters available for later substitution.

Matrix variables are scoped to individual actions and accessible via the matrix namespace during action command evaluation.


Generated via tsdoc2docusaurus 1.3.0-pre by API Extractor/Documenter 7.55.2.