...
Logic API
Logic Nature: rebateAgreement
Logic Type: Calculation/Pricing
Element Group (also called Calculation Contexts) – Every element of the logic can belong to one or more element groups which then determines in which scenario the code of the element will be used. The groups are:
agreement – The element’s code will be executed for a Rebate Line Item (e.g. to define its inputs, calculate results).
agreementReadOnly – The element’s code will be executed for a Line Item, but only if the Agreement is already approved and is "read-only". Such elements are executed when the user opens an approved agreement, so that the user can see e.g. new rebate estimations. But the calculation results are NOT stored.
rebateRecord – The element’s code will be executed for a Rebate Record (i.e. to calculate results, create & calculate Payout Records).
(no group selected) – When you do not assign the element into a specific group, then it is the same as if you would assign it into all 3 groups.
Execution Types – The code of logic elements can be executed in 5 different scenarios/purposes as a combination of execution mode and element group:
Element Group Mode Scenario/Purpose agreement
Input Generation
To build an input field definition for a rebate item
agreement
Standard
To calculate results (e.g. prices) and provide warnings and alerts for a rebate item
rebateRecord
Input Generation
To build an input field definition for a rebate record
rebateRecord
Standard
To calculate results (e.g. prices) and provide warnings and alerts for a rebate record
agreement-ReadOnly
Standard
To calculate results (e.g. prices) and provide warnings and alerts for a rebate item once the agreement is already approved
Information provided to the logic – Varies based on the scenario.
Element Group Mode Input Parameters Binding Variables Current Item api.global agreement
Input Generation
agreement
Standard
Values of line item inputs, values from inherited inputs of parent folders and header
rebateRecords (IRebateRecord-Manager)
Data placed to
api.global
in the Rebate Header logic pre-phase, and data placed toapi.global
by execution of the previous rebate line (within one recalculation process)rebateRecord
Input Generation
RR (Rebate Record)
rebateRecord
Standard
Values of rebate record inputs, copy of values of line item inputs
calculationBase (DMDataSlice), payoutRecords (PayoutRecord-Manager)
RR (Rebate Record)
agreement-ReadOnly
Standard
Values of line item inputs, values from inherited inputs of parent folders and header
rebateRecords (IRebateRecord-Manager)
RALI (Rebate Agreement Line Item)
Expected logic execution outcome
Element Group Mode Expected Logic Result/Outcome agreement
Input Generation
Input field definitions for the RALI
agreement
Standard
Elements result values will appear as a result of the RALI
api.global
– Data stored here will persist until the next execution of this logic for another rebate line item (within one recalculation process)rebateRecord
Input Generation
Input field definitions for the RR, but also for the RALI (otherwise those would not display on the RR detail page)
rebateRecord
Standard
Elements result mapped to the RR (mapping done by naming convention – the columns of RR must have the same names as the elements)
agreement-ReadOnly
Standard
Elements result appears as a result of the RALI
...