Class CompensationBuilder

Object
ObjectIdentity
AbstractBuilder
CalculableLineItemCollectionBuilder<CompensationBuilder>
BasicCompensationBuilder<CompensationBuilder>
CompensationBuilder
All Implemented Interfaces:
CompensationAgreementBuilder

public class CompensationBuilder extends BasicCompensationBuilder<CompensationBuilder> implements CompensationAgreementBuilder
IMPORTANT: Please read super class notes on sequence of execution!
  • Constructor Details

    • CompensationBuilder

      public CompensationBuilder(String instanceId, String classId, IdGenerator idGenerator, Invocations<MethodInvocation> invocations, Object compensationView, HeaderPhase phase)
  • Method Details

    • getCompensationView

      public Object getCompensationView()
      Gets the full compensation object as a nested map. This map contains all header inputs/outputs, and all line items (with their inputs/outputs).
      Returns:
      The compensation object
    • getHelper

      public CompensationHelper getHelper()
      Gets a helper class that assists in manipulating the compensation object. You can use it instead of directly reading the CompensationView map.
      Returns:
      The helper object
    • addCompensationStructure

      public CompensationBuilder addCompensationStructure(CompensationStructure structure)
      Applies a compensation structure. That usually means adding a set of folders and/or items.

      Example:

      
       if (coProcessor.isPrePhase()) {
           def structure = new CompensationStructure()
           productSubCategory.each {
               structure.addFolder(it.attribute2)
           }
           coProcessor.addCompensationStructure(structure)
       }
       
      Parameters:
      structure -
      Returns:
    • addFolder

      public void addFolder(String label)
      Creates and adds a new folder under the ROOT folder.

      If you intend to add many folders and items, use the CompensationStructure approach instead.