Skip to main content

XpmActions._createSubstitutedAction() method

Creates a substituted action from a template and matrix combination.

Signature

protected _createSubstitutedAction({ actionName, jsonAction, combination, newActionsMap, }: {
combination: Record<string, string>;
actionName: string;
jsonAction: JsonActionContent;
newActionsMap: Map<string, XpmAction>;
}): Promise<void>;

Parameters

Parameter

Type

Description

{ actionName, jsonAction, combination, newActionsMap, }

{ combination: Record<string, string>; actionName: string; jsonAction: JsonActionContent; newActionsMap: Map<string, XpmAction>; }

Returns

Promise<void>

A promise that resolves when the action has been created and stored.

Exceptions

XpmError If the action name substitution fails.

Remarks

This helper method is called for each combination generated from a template action's matrix parameters. It performs the actual name substitution and creates the concrete action instance.

Processing steps:

  1. Performs Liquid substitution on the template action name using the specific matrix combination values.
  2. Creates a new XpmAction instance with:
    • The substituted concrete action name.
    • The action's command template (not yet evaluated).
    • Reference to this parent actions collection.
    • The matrix parameter values for later command substitution.
  3. Stores the new action instance in the provided map.

The matrix parameters are preserved in the action instance and will be used later when the action is initialised to substitute matrix references in the command templates.


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