Interface CompensationBuilder

All Superinterfaces:
CalculableLineItemCollectionBuilder<CompensationBuilder>

public interface CompensationBuilder extends CalculableLineItemCollectionBuilder<CompensationBuilder>
Context for manipulating a Sales Compensation object in a compensation header calculation logic.

IMPORTANT: Please read super interface notes on the sequence of execution!

See Also:
  • Method Details

    • getCompensationView

      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

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

      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 - the structure
      Returns:
      itself (for flow pattern)
    • addFolder

      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.

      Parameters:
      label - the folder label