Interface IRebateRecordManager


public interface IRebateRecordManager

The RebateRecordManager API is exposed to Groovy logic elements in the following contexts:

  1. In a RebateAgreement/Compensation calculation (type codes 'RBA' / 'CO'), when the logic context's 'currentItem' is an individual line item (type codes 'RBALI' / 'COLI').
  2. In a RebateAgreement/Compensation 'read-only' evaluation (when opening an uneditable Rebate Agreement or Compensation); currentItem is 'RBALI'.
  3. In a RebateRecordSet/CompensationRecordSet calculation, the formula context's 'currentItem' is an individual RebateRecord (type codes 'RR / COR').

The API can be accessed via the rebateRecords Groovy binding variable.

Context-specific Implementation Notes:

  • Context 1 (Rebate Agreement/Compensations Calculations): Rebate Records / Compensation Records can only be added. The setRank() method is only effective in this context.
  • Context 2 (Read-only Evaluations): Does not allow any modification (adding or updating Rebate Records (RR) / Compensation Records (COR)).
  • Context 3 (RecordSet Calculations): Only allows updating existing Rebate Records (RR) / Compensation Records (COR) (through the set(..) methods).
  • Method Summary

    Modifier and Type
    Method
    Description
    CompensationAgreementRecord
    add(String recordName, String recordSetLabel, Map<?,?>... attributeValues)
    Adds a Rebate Record (RR) / Compensation Record (COR) in the specified Rebate Record Set / Compensation Record Set to the current Rebate Agreement / Compensation line item (RBALI or COLI).
    CompensationAgreementRecord
    add(String recordName, Map<?,?>... attributeValues)
    Adds a Rebate Record (RR) / Compensation Record (COR) with the specified name and attribute values to the current Rebate Agreement / Compensation line item (RBALI / COLI).
    CompensationAgreementRecord
    add(Map<?,?>... attributeValues)
    Adds a Rebate Record (RR) / Compensation Record (COR) with the default name and attribute values to the current Rebate Agreement / Compensation line item (RBALI / COLI).
    ResultCompensationAgreementRecord
    Return a clickable link to the RR/COR with the default name, as the result of a formula element
    ResultCompensationAgreementRecord
    asLink(String recordName)
    Return a clickable link to the RR/COR with the given name, as the result of a formula element
    ResultCompensationAgreementRecord
    asLink(String recordName, String recordSetLabel)
    Return a clickable link to the RR/COR for the given name and RR/COR-set, as the result of a formula element
    asResultMatrix(String... attributes)
    Return a ResultMatrix listing all RR/CORs in the agreement, optionally the fields/attributes to be shown as matrix columns.
    ChartBuilderResult
    buildDataTableChart(String datamartName, String dateDimFieldName)
    Deprecated.
    CompensationAgreementRecord
    get()
    Get the RR/COR with the default name linked to the current RA/CO.lineitem
    CompensationAgreementRecord
    get(String recordName)
    Get the RR/COR with the given name linked to the current RA/CO.lineitem
    CompensationAgreementRecord
    get(String recordName, String recordSetLabel)
    In the given RR/COR-set, get the RR/COR with the given name linked to the current RA/CO.lineitem
    List<CompensationAgreementRecord>
    Get all RR/CORs linked to the current agreement (via RR/COR --> RLI/COLO --> RBA/CO).
    List<CompensationAgreementRecord>
    getAll(String lineId)
    Get all RR/CORs linked to the line item with the given lineID in the current agreement (via RR/COR --> RLI/COLI).
    getResult(String elementName)
    Get the formula element result for the RR/COR with the default name linked to the current RA/CO.lineitem
    getResult(String recordName, String elementName)
    Get the formula element result for the RR/COR with the given name linked to the current RA/CO.lineitem
    getResult(String recordName, String recordSetLabel, String elementName)
    In the given RR/COR-set, get the formula element result for the RR/COR with the given name linked to the current RA/CO.lineitem
    boolean
    set(String recordName, String recordSetLabel, Map<?,?>... attributeValues)
    Sets fields of the Rebate Record (RR) / Compensation Record (COR) in the specified Rebate Record Set.
    boolean
    set(String recordName, Map<?,?>... attributeValues)
    Sets fields of the Rebate Record (RR) / Compensation Record (COR) with the specified name.
    boolean
    set(Map<?,?>... attributeValues)
    Sets fields of the Rebate Record (RR) / Compensation Record (COR) with the default name.
    void
    setGroup(String rebateRecordName, String groupName)
    Assigns the rebate record specified by rebateRecordName to the rebate record group specified by groupName.
    void
    setGroup(String rebateRecordName, String recordSetLabel, String groupName)
    Assigns the rebate record specified by rebateRecordName and recordSetLabel to the rebate record group specified by groupName.
    boolean
    setRank(int rank)
    Sets the rank on the default RR/COR.
    boolean
    setRank(String recordName, int rank)
    Sets the rank on the named RR/COR.
  • Method Details

    • add

      CompensationAgreementRecord add(Map<?,?>... attributeValues)
      Adds a Rebate Record (RR) / Compensation Record (COR) with the default name and attribute values to the current Rebate Agreement / Compensation line item (RBALI / COLI).

      See add(String, Map[]) for more details.

      Parameters:
      attributeValues -
      See Also:
    • add

      CompensationAgreementRecord add(String recordName, Map<?,?>... attributeValues)
      Adds a Rebate Record (RR) / Compensation Record (COR) with the specified name and attribute values to the current Rebate Agreement / Compensation line item (RBALI / COLI).

      Side effects:

      1. Record Set assignment:
        • If the Record Set label is not specified (see add(String, String, Map[])) the Rebate Record is automatically assigned to the "Default" Rebate Records Set.
      2. Rebate Record Group assignment:
        • If the value of HeaderRebateType.recordWorkflowFormulaTarget ("Rebate Record Workflow Object") of the RBA's Rebate Agreement Type is set to REBATERECORDGROUP (meaning that the group should go through a workflow), then the new Rebate Record will be automatically assigned to the Rebate Record Group. The name of the automatically created RRG consists of the uniqueName and payoutDate of the Rebate Agreement (RBA).
        • If the value of HeaderRebateType.recordWorkflowFormulaTarget ("Rebate Record Workflow Object") of the RBA's Rebate Agreement Type is set to REBATERECORD (meaning that the group will not go through a workflow), then the Rebate Record will not be assigned to a Rebate Record Group.
      Note: To assign the Rebate Record (RR) to the specific group (RRG), use the setGroup() method.

      Example:

      
       rebateRecords.add("rr1", [
           "startDate": "2021-09-01",
           "endDate": "2021-09-29",
           "attribute1": 10,
           "attribute2": 15,
           "attributeExtension___fieldName": "value",
       ])
       
      Parameters:
      recordName - The name of the Rebate Record / Compensation Record you want to add.
      attributeValues - A map of field names and values you want to add for the current RebateRecord table.
      See Also:
    • add

      CompensationAgreementRecord add(String recordName, String recordSetLabel, Map<?,?>... attributeValues)
      Adds a Rebate Record (RR) / Compensation Record (COR) in the specified Rebate Record Set / Compensation Record Set to the current Rebate Agreement / Compensation line item (RBALI or COLI).

      Side effects:

      1. Record Set creation:
        • If the Record Set with the specified label does not exist, it will be automatically created.
      2. Rebate Record Group automatic assignment:
        • If the value of HeaderRebateType.recordWorkflowFormulaTarget ("Rebate Record Workflow Object") of the RBA's Rebate Agreement Type is set to REBATERECORDGROUP (meaning that the group should go through a workflow), then the new Rebate Record will be automatically assigned to the Rebate Record Group. The name of the automatically created RRG consists of the uniqueName and payoutDate of the Rebate Agreement (RBA).
        • If the value of HeaderRebateType.recordWorkflowFormulaTarget ("Rebate Record Workflow Object") of the RBA's Rebate Agreement Type is set to REBATERECORD (meaning that the group will not go through a workflow), then the Rebate Record will not be assigned to a Rebate Record Group./ul>
      Note: To assign the Rebate Record (RR) to the specific group (RRG), use the setGroup() method.

      Example:

      
       rebateRecords.add("rr1", "MyFirstRecordSet", [
           "startDate": "2021-09-01",
           "endDate": "2021-09-29",
           "attribute1": 10,
           "attribute2": 15,
           "attributeExtension___fieldName": "value",
       ])
       
      Parameters:
      recordName - The name of the Rebate Record (RR) / Compensation Record (COR) you want to add.
      recordSetLabel - The label of the RebateRecordSet (RRS) or CompensationRecordSet (CORS) you want the Record to be assigned to. If the label does not exist, a new Record Set is created.
      attributeValues - The map of field names and values you want to add to the current RebateRecord / CompensationRecord.
      See Also:
    • setRank

      boolean setRank(int rank)
      Sets the rank on the default RR/COR. RR/CORs with a lower rank are calculated first within a given agreement.
    • setRank

      boolean setRank(String recordName, int rank)
      Sets the rank on the named RR/COR. RR/CORs with a lower rank are calculated first within a given agreement.
    • setGroup

      void setGroup(String rebateRecordName, String groupName)
      Assigns the rebate record specified by rebateRecordName to the rebate record group specified by groupName. If the group of that name does not exist, it will be created.
      Parameters:
      rebateRecordName -
      groupName -
    • setGroup

      void setGroup(String rebateRecordName, String recordSetLabel, String groupName)
      Assigns the rebate record specified by rebateRecordName and recordSetLabel to the rebate record group specified by groupName. If the group of that name does not exist, it will be created.
      Parameters:
      rebateRecordName -
      recordSetLabel -
      groupName -
    • getAll

      List<CompensationAgreementRecord> getAll()
      Get all RR/CORs linked to the current agreement (via RR/COR --> RLI/COLO --> RBA/CO).
    • getAll

      List<CompensationAgreementRecord> getAll(String lineId)
      Get all RR/CORs linked to the line item with the given lineID in the current agreement (via RR/COR --> RLI/COLI).
    • get

      CompensationAgreementRecord get()
      Get the RR/COR with the default name linked to the current RA/CO.lineitem
    • get

      CompensationAgreementRecord get(String recordName)
      Get the RR/COR with the given name linked to the current RA/CO.lineitem
    • get

      CompensationAgreementRecord get(String recordName, String recordSetLabel)
      In the given RR/COR-set, get the RR/COR with the given name linked to the current RA/CO.lineitem
    • set

      boolean set(Map<?,?>... attributeValues)
      Sets fields of the Rebate Record (RR) / Compensation Record (COR) with the default name.

      See Also:
    • set

      boolean set(String recordName, Map<?,?>... attributeValues)
      Sets fields of the Rebate Record (RR) / Compensation Record (COR) with the specified name.

      Example:

      
       rebateRecords.set("rr1", [
           "attributeExtension___fieldName": "value",
           "attribute1"                    : 161.3,
           "attribute2"                    : "test",
       ])
       
      Parameters:
      recordName - The name of the Rebate Record or Compensation Record object you want to update.
      attributeValues - A map of field names and values you want to set for the current RebateRecord object.
    • set

      boolean set(String recordName, String recordSetLabel, Map<?,?>... attributeValues)
      Sets fields of the Rebate Record (RR) / Compensation Record (COR) in the specified Rebate Record Set.
      Parameters:
      recordName - The name of the Rebate Record or Compensation Record object you want to update.
      recordSetLabel -
      attributeValues - A map of field names and values you want to set for the current RebateRecord object.
      See Also:
    • getResult

      Object getResult(String elementName)
      Get the formula element result for the RR/COR with the default name linked to the current RA/CO.lineitem
    • getResult

      Object getResult(String recordName, String elementName)
      Get the formula element result for the RR/COR with the given name linked to the current RA/CO.lineitem
    • getResult

      Object getResult(String recordName, String recordSetLabel, String elementName)
      In the given RR/COR-set, get the formula element result for the RR/COR with the given name linked to the current RA/CO.lineitem
    • asLink

      ResultCompensationAgreementRecord asLink()
      Return a clickable link to the RR/COR with the default name, as the result of a formula element
    • asLink

      ResultCompensationAgreementRecord asLink(String recordName)
      Return a clickable link to the RR/COR with the given name, as the result of a formula element
    • asLink

      ResultCompensationAgreementRecord asLink(String recordName, String recordSetLabel)
      Return a clickable link to the RR/COR for the given name and RR/COR-set, as the result of a formula element
    • asResultMatrix

      ResultMatrix asResultMatrix(String... attributes)
      Return a ResultMatrix listing all RR/CORs in the agreement, optionally the fields/attributes to be shown as matrix columns.
    • buildDataTableChart

      @Deprecated ChartBuilderResult buildDataTableChart(String datamartName, String dateDimFieldName)
      Deprecated.