Step 1 - (Optional) Modify the schema selection description
If the field we want to turn into a level is not currently in our schema selection, then the first step is to add it. The cube selection is made by retrieving all fields from a datastore except unwanted ones, so adding an extra field to an existing store will add it to the selection. Only extra datastore fields will need a change on the selection. Fields are added to the schema selection by creating a Spring Bean with typeUnaryOperator<CanUseOtherReference> and qualifier
SchemaSelection_CUBENAME_ (for example,
SchemaSelectionStandardisedApproachCube).
For example:
Step 2 - Create the level
The field in the schema selection can now be turned into a level in the cube. Dimensions, hierarchies, and levels can be added to the cube configuration by creating Spring Beans with typeDimensionsAdder
and qualifier Dimensions_CUBENAME_ (for example,DimensionsStandardisedApproachCube).
For example:
The order has been set to 50 so that this dimension is added after the existing dimensions (order=20) and before the epoch dimension
(order=99).
Step 3 - Include our modifications in FRTBConfig
These beans can be placed in either of the following locations:com/activeviam/frtb/starter/cfg/impl/CubesDimensionsConfig.javadirectly with other dimension beans- moved to a new configuration class. If you choose this option, be sure to include our configuration classes which contain our beans in the application config class
FRTBConfiglocated in/frtb-starter/src/main/java/com/activeviam/frtb/starter/cfg/impl/