Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Since version 9.0

On the Compensation Plan detail page, there are two buttons to recalculate the document. The difference is in how many lines are calculated.

  • Recalculate – Recalculates all line items.

  • Recalculate Changes – Recalculates only the line items which have changed compared to the previously calculated version. (Note that the button is in the line item’s panel with input parameters.)

A change of a line is, for example:

  • Change of item’s input field

  • Change of item’s label

  • Change of item’s result override

  • Change of header input field

A line item has the field dirty which is set by the system to true for each line which should be recalculated.

  • So for "full" recalculation, all items will be marked dirty.

  • For Recalculate Changes, only lines with some changes

If you want, you can read the value of the item’s dirty field in the header logic’s post-phase, and do only processing of the recalculated items.

compensation recalculation.drawio

The process involves the following actions:

  1. The system executes the header logic in pre-phase mode. Such code can create input fields on the header and modify the structure of the document (e.g. create/delete/update line items and folder).

  2. For every item:

    1. The system executes the compensation logic (only elements from the group compensation) in the standard mode. This logic will calculate and provide the results.

    2. The system will store those results to the line item.

  3. The system executes the header logic again, but in the post-phase mode. Such code can calculate summarized results of the whole document and store the results to the header (or to line items).

  • No labels