How to Handle Passing Values within Quote's Header Logics, Configurators and Line Item Logic

Written by: Jachym Krasek, Jiri Skorvanek


This article summarizes possible solutions for different use cases of passing on values within Quote’s different calculation logics.

We tried to describe possible solutions, some obstacles or wrong ways how to do it. Please feel free to comment the solutions.

Calculation Logic Architecture Prerequisities

How different logics are executed from the Quote perspective:

Syntax Check

This dry run is used to discover inputs in the line items. Most of other API calls are mocked. Be aware that syntax check dry run is executed only once in case of adding a new line item.

Other Logics Executable from Quote

There are two other logics which can be executed from header logics:

  • Configurator Logic

    • This logic is executed after clicking the Open Button of a configurator:

      After clicking the Save button in the configurator pop-up, a new configurator value is saved to the Quote object. (The quote object is what you get by calling quoteProcessor.getQuoteView()). But you cannot work with the values until the Quote is recalculated. This is because the logic knows only the old Quote object since all other calculation logics finished before the configurator logic was executed. You must click the Recalculate button or set automatic recalculation (for details see how to recalculate a quote automatically).

  • Template Logic

    • This logic is executed after clicking the Download PDF button.

    • From the template logic the whole quote object is accessible through api.getCurrentItem().

Summary of Passing Values between Different Types of Logics

Use case

From

To

Solution

Use case

From

To

Solution

1

Quote Header Logic Configurator

Quote Header Logic

Read the configurator value field.

2

Quote Header Logic

Quote Header Logic Configurator

Pass through the configurator value field, read using a HIDDEN field inside the configurator.

3

Quote Header Logic

Line Item Logic

Hidden input (pre-phase).

4

Line Item Logic

Header Logic

Read from getQuoteView() (post-phase).

5

Quote Header Logic

Publishing Template Logic

Hidden input or api.currentItem (provides quoteView).

6

Quote Header Configurator

Line Item Logic

Hidden input.

7

Line Item Logic

Quote Header Logic Configurator

Read from getQuoteView() (post-phase), pass to the configurator trough a value field.

8

Quote Header Logic Configurator

Line Item Logic Configurator

Not possible, please see details below, including workaround.