How to Modify What Is Saved in Condition Records
The current implementation has a specific Condition Records structure to fit the Cost Plus use case implemented in the Accelerator. The structure can be freely changed to meet project requirements.
To modify what is saved in Condition Records:
Step 1 – Modify Condition Records Set
Go to Administration > Configuration > Condition Record Sets (Master Data section) > AGR_DefaultCondition_Record_Set and modify any columns/attributes to fit your calculation outputs.
You can also create new Condition Record set instead, but remember to change the CONDITION_RECORD_SET_NAME
value to the name of the new set in the library AGR_ProcessingLib element ConstConfig. The new set must have the same keys as the AGR_DefaultCondition_Record_Set.
Step 2 – Modify ConditionRecords Element
Go to the AGR_FormulaBasedPricing logic and open the ConditionRecords
element.
There are several variables that hold important information, these are:
calculationParameters
– Stores all possible parameters to be used by Calculation Engine CalculationParameters.processedCalculationOutputs
– Stores all calculation outputs in a Map format. The Map’s main key is a combination of Currency and UOM used for that run of calculation (based on selected CalculationOutputTypes). The content is :[outputCurrency : outputCurrency, outputUom : outputUom, exchangeRate : exchangeRate, conversionFactor : conversionFactor, calculationResults : [:]]
where:
outputCurrency
– Currency of the run as defined by CalculationOutputTypes.outputUom
– Unit of measure of the run as defined by CalculationOutputTypes.exchangeRate
– Exchange rate used to convert from the calculation currency to the current outputCurrency.conversionFactor
– Conversion factor used to convert from the calculation unit of measure to the current outputUom.calculationResults
– Extended outputs of the EngineCalculator in a Map format, grouped by SKU. This contains the map returned by the Calculation method.
The format of the Maps stored under calculation Results looks as follows:[(sku): [engineResult : engineResult, boundedResult : boundedResult, boundStatus : boundStatus, previousResult : previousResult, calculationStatus: calculationStatus, convertedResult : convertedResult]]
engineResult
– this is the Map that is returned from the Calculation method.boundedResult
– if Lower/Upper Bounds are applied, this property contains the result from the Calculation method.boundStatus
– if Lower/Upper Bounds are applied, this property indicates whether the upper or lower bound has been applied. This value is present only during recalculation.previousResult
– if Lower/Upper Bounds are applied, this property contains the result from the Calculation method of the Previous Period.calculationStatus
– defines whether the calculation finished with or without error. Values stored inCALCULATION_STATUS
Map in AGR_ProcessingLib/ConstConfig.convertedResult
– contains the result from the Calculation method that has been converted using UoM and Currency conversions.
To change the structure, you must modify the Map variable called conditionRecordStructure, to reflect the new or modified attributes from Step 1 – this means assigning the proper values to the appropriate attribute keys.