On the Compensation Plan detail page, there are 2 buttons, which cause document recalculation. The difference is in how many lines are calculated.
-
Recalculate - all line items are recalculated
-
Recalculate Changes - recalculate only the line items, which have some changes against the previously calculated version. (Note, that the button is on the line item’s panel with input parameters.)
A change of the 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 field dirty
, which is set by 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.
The process involves the following actions
-
the system executes the header logic in pre-phase mode - Such code can create input fields on header and modify the structure of the document (e.g. create/delete/update the line items and folder)
-
for every item,
-
the system executes the compensation logic (only elements from group compensation) in normal mode - This logic will calculate and provide the results.
-
The system will store those results to the line item.
-
-
the system executes the header logic again, but in post-phase mode - such code can calculate summarized results of the whole document and store the results to the header (or to line items)