Class RebateAgreementStructure

Object
CompensationAgreementStructure
RebateAgreementStructure

public class RebateAgreementStructure extends CompensationAgreementStructure
Describes code-generated content for one level of the Rebate Agreement folder tree. A Rebate Agreement (RA) header logic uses it to add many folders and line items in one call.

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) and addFolder(label, inputs) create a folder, add it to this level, and return it.
  • addItem(name) and addItem(name, inputs) create a line item for the Rebate Type with the unique name name, add it to this level, and return it.
  • createFolder(label) and createItem(name) create a folder or a line item but do not add it. Add the result to the items list of a folder.
The 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
    Constructor
    Description
     
  • Method Summary

    Methods inherited from class CompensationAgreementStructure

    addFolder, addFolder, addItem, addItem, createFolder, createItem

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RebateAgreementStructure

      public RebateAgreementStructure()