Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Logic API

  • Logic Nature: default

    • Logic Type: Calculation/Pricing

  • Execution Types:

    • Syntax Check Input Generation – Defines input fields for a price grid (i.e. NOT for items).

    • Standard – Calculates the results (e.g. prices) and provides warnings and alerts for each item.

  • Information provided to the logic:

    • In the Syntax Check Input Generation mode:

      • SKU in the logic context

    • In the Standard mode:

      • SKU in the logic context

      • input – Values of all inputs provided by the user. Or values passed into the calculation when it is executed from Calculation Flow, via the method withFormulaParameters().

      • api.currentItem() has PricegridItem – In this case, unlike with a price list, the current item is available all the time because the item is already created before the logic is executed.

      • api.global – Contains data placed to api.global by the previous execution of this logic for the another line (within one price grid calculation process).

  • Expected logic execution outcome:

    • From Syntax Check Input Generation mode:

      • Input field definitions

    • From Standard mode execution:

      • Result values (and formatting) of the visible logic elements will be copied by the system to the attributeX fields of the PricegridItem.

      • api.global– Data stored here will persist until the next execution of this logic for another line (within one price grid calculation process within one node).

Common Logic Structure

  1. Build input field definitions.

  2. Abort on syntax checkinput generation.

  3. Calculate prices and other values.

...