Package net.pricefx.formulaengine
Interface IRebateRecordManager
public interface IRebateRecordManager
The RebateRecordManager API is exposed to Groovy logic elements in the following contexts:
- In a RebateAgreement/Compensation calculation (type codes 'RBA' / 'CO'), when the logic context's '
currentItem
' is an individual line item (type codes 'RBALI' / 'COLI'). - In a RebateAgreement/Compensation 'read-only' evaluation (when opening an uneditable Rebate Agreement or Compensation); currentItem is 'RBALI'.
- 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 TypeMethodDescriptionCompensationAgreementRecord
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
orCOLI
).CompensationAgreementRecord
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
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
asLink()
Return a clickable link to the RR/COR with the default name, as the result of a formula elementResultCompensationAgreementRecord
Return a clickable link to the RR/COR with the given name, as the result of a formula elementResultCompensationAgreementRecord
Return a clickable link to the RR/COR for the given name and RR/COR-set, as the result of a formula elementasResultMatrix
(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.lineitemCompensationAgreementRecord
Get the RR/COR with the given name linked to the current RA/CO.lineitemCompensationAgreementRecord
In the given RR/COR-set, get the RR/COR with the given name linked to the current RA/CO.lineitemList
<CompensationAgreementRecord> getAll()
Get all RR/CORs linked to the current agreement (via RR/COR --> RLI/COLO --> RBA/CO).List
<CompensationAgreementRecord> Get all RR/CORs linked to the line item with the given lineID in the current agreement (via RR/COR --> RLI/COLI).Get the formula element result for the RR/COR with the default name linked to the current RA/CO.lineitemGet the formula element result for the RR/COR with the given name linked to the current RA/CO.lineitemIn the given RR/COR-set, get the formula element result for the RR/COR with the given name linked to the current RA/CO.lineitemboolean
Sets fields of the Rebate Record (RR) / Compensation Record (COR) in the specified Rebate Record Set.boolean
Sets fields of the Rebate Record (RR) / Compensation Record (COR) with the specified name.boolean
Sets fields of the Rebate Record (RR) / Compensation Record (COR) with the default name.void
Assigns the rebate record specified by rebateRecordName to the rebate record group specified by groupName.void
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
Sets the rank on the named RR/COR.
-
Method Details
-
add
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
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:
- 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.
- If the Record Set label is not specified (see
- Rebate Record Group assignment:
- If the value of
HeaderRebateType.recordWorkflowFormulaTarget
("Rebate Record Workflow Object") of the RBA's Rebate Agreement Type is set toREBATERECORDGROUP
(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 theuniqueName
andpayoutDate
of the Rebate Agreement (RBA). - If the value of
HeaderRebateType.recordWorkflowFormulaTarget
("Rebate Record Workflow Object") of the RBA's Rebate Agreement Type is set toREBATERECORD
(meaning that the group will not go through a workflow), then the Rebate Record will not be assigned to a Rebate Record Group.
- If the value of
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:
- Record Set assignment:
-
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
orCOLI
).Side effects:
- Record Set creation:
- If the Record Set with the specified label does not exist, it will be automatically created.
- Rebate Record Group automatic assignment:
- If the value of
HeaderRebateType.recordWorkflowFormulaTarget
("Rebate Record Workflow Object") of the RBA's Rebate Agreement Type is set toREBATERECORDGROUP
(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 theuniqueName
andpayoutDate
of the Rebate Agreement (RBA). - If the value of
HeaderRebateType.recordWorkflowFormulaTarget
("Rebate Record Workflow Object") of the RBA's Rebate Agreement Type is set toREBATERECORD
(meaning that the group will not go through a workflow), then the Rebate Record will not be assigned to a Rebate Record Group./ul>
- If the value of
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:
- Record Set creation:
-
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
Sets the rank on the named RR/COR. RR/CORs with a lower rank are calculated first within a given agreement. -
setGroup
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
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
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
Get the RR/COR with the given name linked to the current RA/CO.lineitem -
get
In the given RR/COR-set, get the RR/COR with the given name linked to the current RA/CO.lineitem -
set
Sets fields of the Rebate Record (RR) / Compensation Record (COR) with the default name.- See Also:
-
set
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
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
Get the formula element result for the RR/COR with the default name linked to the current RA/CO.lineitem -
getResult
Get the formula element result for the RR/COR with the given name linked to the current RA/CO.lineitem -
getResult
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
Return a clickable link to the RR/COR with the given name, as the result of a formula element -
asLink
Return a clickable link to the RR/COR for the given name and RR/COR-set, as the result of a formula element -
asResultMatrix
Return a ResultMatrix listing all RR/CORs in the agreement, optionally the fields/attributes to be shown as matrix columns. -
buildDataTableChart
Deprecated.
-