The reference implementation of supports fact-level and roll-over adjustments for the InternalModelApproachCube, IMADRCCube, PLCube and StandardisedApproachCube cubes. As an example of how to configure a new custom adjustment, this page will walk through how PNL adjustments have been defined within the starter module in theDocumentation Index
Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
Use this file to discover all available pages before exploring further.
frtb-starter/src/main/java/com/activeviam/frtb/starter/signoff/adjustments/ directory.
Configure Adjustment Execution
All adjustment processes are defined within theAdjustmentExecutionConfig.java class. Other library classes are mentioned where relevant.
Fact-level adjustments
Fact-level adjustments are modifications of the underlying data held in the datastore. They operate directly on datastore rows, usingExecution objects containing functional
components.
These functional components are defined in the ExecutionFunctionalComponents.java class.
The Execution object
| Field | Description |
|---|---|
| appliesOnAdjustments | Determines whether or not the current adjustment applies for rows created by a previous adjustment. |
| inputParser | A BiFunction that takes the request and definition DTOs and matches the required definition inputs to the input provided in the request. The values of the request inputs are parsed using the IParser objects matching the type found in the definition. |
| inputRetriever | A TriFunction that takes a datastore row, the store format and a list of store fields and returns an object representing the value to be adjusted. |
| sourceTagger | A List of TriFunction objects that take an execution ID and the initial values of the Source and Input type fields and return a map with the new values of those fields. |
| valueField | The datastore field that holds the values that will be adjusted by the execution. |
| expectedInputs | The List of expected inputs required by the execution. |
| inputConverter | A BiFunction that takes the result of the inputParser and the expectedInputs and generates the request inputs to be used in the adjustment steps. |
| steps | A list of BiFunction objects that use the results of the inputRetriever and inputConverter to create the adjusted values that will be written to the datastore. |
Add On Execution
appliesOnAdjustmentsisfalsesourceTaggercontains:userInputSourceTagging()- tags the row as direct user input
stepscontains:doubleInputReplacer()- replaces the initial value with the request input value
Scaling Execution
appliesOnAdjustmentsistruesourceTaggercontains:inverseTagging()- tags a row as the inversion of the initial rowscaleTagging()- tags the row as a scaling of the initial row
stepscontains:doubleInverter()- the execution replaces the initial value with its inverse (initialValue * -1.0)doubleScaler()- the execution replaces the initial value with the scaled value (initialValue * scalingFactor)
Override Execution
appliesOnAdjustmentsistruesourceTaggercontains:inverseTagging()- tags a row as the inversion of the initial rowuserInputSourceTagging()- tags the row as direct user input
stepscontains:doubleInverter()- the execution replaces the initial value with its inverse (initialValue * -1.0)doubleInputReplacer()- replaces the initial value with the request input value
Roll-over adjustments
Roll-over adjustments operate on the datastore, replacing the rows corresponding to the current as-of date with the approved rows from the input as-of date. The executors use therollOver() method with the following arguments:
| Argument | Description |
|---|---|
| inverters | A Map of inverter Function objects for the datastore fields that should be inverted by the roll-over. |
| inverseTagging | Tagging TriFunction to generate the source and input tags for an inverted datastore row. |
| rollOverTagging | Tagging TriFunction to generate the source and input tags for a rolled-over row. |
inverters are as follows:
inPlaceDoubleOrArrayInverter() function returns input * 1.0 for double inputs and ((IVector) input).scale(-1.0) for IVector inputs.
Include Defined Executions in Executors Map
Now that we have defined our adjustment executions we need to add them to our executorsMap which will be accessed by the services defined in the Sign-off API library.
We want to include our executors in the bean with the qualifier SP_QUALIFIER__EXECUTORS
Note that our executors are included in both profiles.
Define required dimensions for sign-off adjustments
Navigate toPLSignOffAnalysisConfig.java
We add SignOff Source Dimension to the appropriate cube in this case PLCube.
Add source tagging fields
This will add extra fields to describe the adjustments and handle the sign-off. Navigate toPLSignOffAnalysisConfig.java
Define the sign-off task store
This store will hold the sign-off task for the sign-off task hierarchy and task filtering. This store is defined from the base cube store and the required levels to filter on. The specific Datastore Schema Description Post-Processor will introspect the cube description and create the sign-off store compatible with the required level. Navigate toPLSignOffAnalysisConfig.java
Define supported Adjustment
Navigate toSupportedAdjustmentsConfig
Define a SupportedAdjustmentDTO bean.