Rebate Templates use a Groovy logic to construct Rebate Agreements with a builder-like API. (The same pattern as for charts, headers etc.). You "chain" your requirements for a Rebate Agreement and then call the build method at the end. The logic is defined in the Configuration section.
The most used methods and objects are:
-
ROOT– ID for the root line item, the Rebate Agreement itself. -
ratBuilder – Groovy binding which is available in the template context.
-
fromParams(params)– Creates a new Rebate Agreement with parameters; the available parameters are:label,startDate,endDate. -
addOrUpdateInput(lineId, params)– Adds/updates the input. -
addLineItemWithId(lineId, type)– Adds a new line item to the Rebate Agreement, specified with the string type – rebate type unique name. -
build()– Build function which has to be called after all the requested modifications.
-