/
Activation and Versioning (Strategy Designer)

Activation and Versioning (Strategy Designer)

Activation

Activating Strategy

Once you are satisfied with the strategy, you can activate it in order to deploy it to the partition.

Before the actual deployment, the user is asked to provide a reason for activation. This can be any text that will later appear in the Version history to document why the strategy has been updated.

image-20250120-145850.png
The activation prompt.

This is what happens afterwards:

  • Each child snippet or lookup in a draft state is activated as well (see below the Rules of Activation)

  • The strategy’s code, which includes all snippets and lookups used by it, will be deployed to the Groovy library specified in the groovyLibraryName configuration entry. By default, this is called “CustomPricingStrategiesLib”. Since Caribou Lou, the deployment is done in the backend.

  • Depending on the Price Setting Accelerator version:

    • Pre-2.4: Two entries will be added to the “StrategyDefinition” PP — one for the Independent level and one for the Dependent level.

    • Version 2.4 and later: The deployment logic specified in the deploymentLogicName configuration entry will be executed. This logic should populate the “StrategyDefinition” PP and can perform any additional actions that the PSP considers necessary.

What happens is influenced by whether the deploymentLogicName is present or absent in the configuration. The Price Setting Accelerator version 2.4 and later includes this entry and creates the deployment logic when it is deployed through the Platform Manager.

Activating Snippet

A new snippet cannot be activated on its own. Instead, you should use it in a strategy and activate that strategy. When a strategy is activated, it automatically activates all the draft snippets and lookups it contains (see below the Rules of Activation).

When you create a new version of an existing snippet, you can activate it as soon as you’re satisfied with it. You’ll be prompted to provide a reason for the activation. This is because activating a new version of a snippet will supersede one or more strategies that use it, and the reason for activation will be noted alongside each new active version. Once a snippet is activated, it will trigger the creation of a new version for each strategy that utilizes that snippet. Additionally, activating a snippet will also activate any draft lookups that it utilizes.

Activating a new version of a snippet can trigger the creation of new versions for multiple strategies, depending on how many strategies the snippet was used in.

Activating Lookup

A new lookup cannot be activated on its own. Instead, you should use it in a strategy and activate that strategy. When a strategy is activated, it automatically activates all the draft snippets and lookups it contains (see below the Rules of Activation).

When you create a new version of an existing lookup, you can activate it as soon as you’re satisfied with it. You’ll be prompted to provide a reason for the activation. This is because activating a new version of a lookup will supersede one or more strategies that use it, and the reason for activation will be noted alongside each new activeOnce a snippet is activated, it will trigger the creation of a new version for each strategy that utilizes that snippet.

Activating a new version of a lookup can trigger the creation of new versions for multiple snippets and strategies, depending on how many snippets and strategies the snippet was used in.

Rules Of Activation

Since the Strategy, Snippet, and Lookup form a hierarchy, certain rules must be enforced to maintain integrity when users create new versions of each. The rules are as follows:

  1. Relationships Between Entities:

  • A Strategy (parent) can reference Snippets (children) and/or Lookups (children).

  • A Snippet (parent) can reference Lookups (children).

  1. Parent-Child Activation Rules:

  • An Active parent can reference an Active child.

  • A Draft parent can reference either an Active child or the latest version of a Draft child.

  1. Activating a Draft (version n):

  • If version n is greater than 1, the previous version (n-1) must be superseded.

  • If the item has Draft children, activate all its Draft children.

  • If the item has Active parents:

    • For each Active parent (version m):

      • If a Draft version (m+1) already exists:

        • Create a new Draft version (m+1) from the Active parent (m) and activate it.

        • Increase the version of the existing Draft to m+2.

      • If no Draft exists for m+1, create a new Draft (m+1) and activate it.

  1. Recursive Rule Application:

  • After completing the above steps, re-evaluate Rule 3 for any new drafts or activations recursively.

Legend:

  • Activate: Change the status of an item to “Active.”

  • Supersede: Change the status of an item to “Superseded.”

  • Create a new Draft: Make a copy of an item, assign it the next version number, and mark it as “Draft.”