Class RebateAgreementStructure
Create the object with new RebateAgreementStructure() in an RA header logic, fill it, and
pass it to RebateAgreementBuilder.addRebateAgreementStructure(RebateAgreementStructure) on the
raProcessor binding variable. The content is added to the Rebate Agreement after the header
logic finishes.
One object represents one level of the folder tree, not the full Rebate Agreement. The
parentId field defines the level. When parentId is null (the default) or
"ROOT", the content is added at the root level. To add content under an existing folder, set
parentId to the line ID of that folder. To build nested folders in one object, put the child
items into the items list of a folder.
The class inherits these methods:
addFolder(label)andaddFolder(label, inputs)create a folder, add it to this level, and return it.addItem(name)andaddItem(name, inputs)create a line item for the Rebate Type with the unique namename, add it to this level, and return it.createFolder(label)andcreateItem(name)create a folder or a line item but do not add it. Add the result to theitemslist of a folder.
inputs argument is a list of input maps, for example
[[name: "Quantity", value: 10, type: "USERENTRY"]].
If no Rebate Type matches the unique name of a line item, that line item is not created and no error is raised.
The header logic runs in the pre-phase and in the post-phase, and the content is added each time
addRebateAgreementStructure is called. Call it inside raProcessor.isPrePhase() so the
content is added once per calculation.
Example:
if (raProcessor.isPrePhase()) {
def structure = new RebateAgreementStructure()
def folder = structure.addFolder("Volume Rebates")
folder.items = [structure.createItem("VolumeRebate")]
structure.addItem("Promotion", [[name: "Quantity", value: 10, type: "USERENTRY"]])
raProcessor.addRebateAgreementStructure(structure)
}
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class CompensationAgreementStructure
CompensationAgreementStructure.Item -
Field Summary
Fields inherited from class CompensationAgreementStructure
items, parentId -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class CompensationAgreementStructure
addFolder, addFolder, addItem, addItem, createFolder, createItem
-
Constructor Details
-
RebateAgreementStructure
public RebateAgreementStructure()
-