Simple Datastore Changes What-If Simulations
Atoti FRTB provides the ability to configure simple What-If simulations which modify data in the datastore. This is useful for simulating changes to the underlying data without affecting the master branch.
Example: Inclusion Flag Change
The what-if simulation to change the Inclusion hierarchy is included in application.yaml
and can be used as an example:
whatif.datastore:
inclusion-change:
name: "Inclusion Flag Change"
base-store: "TradeMapping"
filters:
- name: "As-of Date"
store-field: "AsOfDate"
level: "AsOfDate@Date@Dates"
- name: "Trade Id"
store-field: "TradeKey"
level: "TradeId@Trades@Booking"
inputs:
- store-field: "Inclusion"
This configuration will result in:
- a what-if simulation defined in the backend.
- the addition of a new REST Endpoint to execute the what-if simulation.
- a context menu item and popup widget to allow the user to execute the what-if simulation.
In this example, the identifier for the what-if simulation is inclusion-change
.
This identifier will be used in the resulting REST Endpoint and in the WhatIf Manager.
We are changing the Inclusion
field in the TradeMapping
datastore.
The base-store
field specifies the store to be modified.
And the inputs
specifies the field to be modified.
The filters
section serves two roles:
- identifies the store fields to be used to determine which rows in the store to modify.
- specifies the levels used in the UI; the what-if will be available in the UI context menu for cells with those levels, and it will include the coordinates for those levels in the REST Endpoint request.
Configuration properties
The configuration of a what-if simulation is done through the Spring Boot properties. For example, application.yaml
.
The properties start with whatif.datastore.<identifier>
, where <identifier>
is the ID of the what-if simulation.
The ID is used in the URL of the resulting REST Endpoint and in the WhatIf Manager.
whatif.datastore.<identifier>.name
The name of the what-if simulation. This is used in the UI context menu to identify the what-if simulation.
whatif.datastore.<identifier>.base-store
The name of the store to be modified.
whatif.datastore.<identifier>.cubes
A list of cube names for which this what-if simulation is available. If this property is not used, the what-if simulation is available for all cubes.
whatif.datastore.<identifier>.filters[<index>]
A list of filters that are used both in the UI to control where the what-if simulation is available, and to determine which rows in the store to modify.
Where <index>
is an integer representing the zero-based index of the filter within the list.
whatif.datastore.<identifier>.filters[<index>].name
The name of the filter. This is used in the UI popup widget to identify the filter.
If this is not specified, the name of the store field is used.
whatif.datastore.<identifier>.filters[<index>].store-field
The name of the store field to be used as a filter.
whatif.datastore.<identifier>.filters[<index>].level
The level description for the cube level to be used in the UI. This is used to determine where the what-if simulation is available in the UI context menu. The UI will populate the filter in the popup widget with the coordinates of the cell for this level.
whatif.datastore.<identifier>.inputs[<index>]
A list of inputs that are used to determine what information to collect in the UI and which fields in the store to modify.
Where <index>
is an integer representing the zero-based index of the input within the list.
whatif.datastore.<identifier>.inputs[<index>].store-field
The name of the store field to be modified.
whatif.datastore.<identifier>.inputs[<index>].name
The name of the input. This is used in the UI popup widget to identify the input field.
If this is not specified, the name of the store field is used.
whatif.datastore.<identifier>.inputs[<index>].type
The type of the input to be used in the UI.
It can take the following values:
string
: a freeform string input field.date
: a date input field.double
: a double input field.int
: an integer input field.
If not specified, the type is string
.
whatif.datastore.<identifier>.inputs[<index>].level
If set, the input will be a selection list. This is also the level description for the cube level that the UI will use to populate the list.