Integrating the Limits Module with ActivePivot
This section walks you through integrating the Limits Module with ActivePivot.
Configurations in the Limits Module
In limits.properties, configure the following properties:
Accelerator Parameters
Some Accelerator parameters are needed in order to allow the Limits module to discover and communicate with the connected Accelerators.
Property | Description |
---|---|
acc.url.map |
Mapping of Accelerator name to the URL of it’s /pivot/rest/vX/cube . vX should be replaced with the corresponding version identifier for your ActivePivot version. |
acc.asOfDate.dim.map |
Mapping of the Accelerator’s AsOfDate dimension, hierachy and level. “Level@Hierarchy@Dimension” |
acc.auth.map |
Mapping of the Accelerator’s Credentials to use to create new KPIs and read Cube structures such as Dimensions and Measures. This is a Base64 encoded “User:Password” string. |
limits.rest.url |
The URL where Limit’s REST APIs are located, Ex: http://localhost:3090/limits/rest/v1/ . |
limits.auth |
The authentication to use in REST requests to the Limits server from the connected Servers. |
content.server.url |
The URL of the remote Content Server. Ex: http://localhost:8080/frtb-starter/content |
content.server.auth |
The encoded authentication to use in REST requests to the Content Server. |
Accelerator Authentication
The encoded authentication is needed for Limits to be able to communicate with the connected Accelerator. This encoded string can easily be created
using Java’s java.util.Base64
utility. The format of the encoded authentication is “user:password”. This encoded string will be used in the REST request header when communicating between different components remotely.
Here’s an example of how to generate the string using Java:
String encodedAuth = Base64.getEncoder().encodeToString(("user:password").getBytes())
// Value of encoded auth:
encodedAuth = "dXNlcjpwYXNzd29yZA=="
Here’s an example snippet of what these properties look like in the limits.properties
file:
acc.url.map={'MRA': 'http://localhost:10010/risk-activepivot/pivot/rest/v5/cube', 'FRTB': 'http://localhost:8080/frtb-starter/pivot/rest/v5/cube'}
acc.asOfDate.dim.map={'MRA': 'AsOfDate@Date@Dates', 'FRTB': 'AsOfDate@Date@Dates'}
acc.auth.map={'MRA': `dXNlcjpwYXNzd29yZA==`, 'FRTB': `dXNlcjpwYXNzd29yZA==`}
limits.rest.url=http://localhost:3090/limits/rest/v1/
limits.auth=dXNlcjpwYXNzd29yZA==
content.server.url=http://localhost:8080/frtb-starter/content
content.server.auth=dXNlcjpwYXNzd29yZA==
Path to the directory alerts written to
The path needs to be part of the input.data.root.dir.path as the CSV source picks up the alert file real time and saves the alert to the datastore.
alert.output.data.dir.path=${input.data.root.dir.path}/data/alert
task-scheduler-thread-pool-size=4
Intraday Observation Frequency
Alert task is automatically scheduled based on the following settings:
- sample-rate-minutes=*
- sample-rate-seconds=0
Parent-Child hierarchies
For Scopes of Parent-Child hierarchies, the hierarchy name must be included in the scope definition. The format would become:
Testing properties
Target directory for Export
limit_export.target_dir=extractionOutput
Test file’s path for Upload
limit_upload.file_path=limits_approve_uploadTest.csv
For testing Uploading and Exporting Limits, the following properties must be set either in properties file or as Spring arguments.
Reference Data
- limits_approve_mra.csv is for the Market Risk Accelerator. By default, it is located under limits-starter/src/test/resources/data-samples/data/2018-09-28 and loaded during startup.
- limits_approve_frtb.csv is for the FRTB Accelerator, located in limits-starter/src/test/resources/data-samples/data/. Please relocate it to the “date” folder if you run Limits with FRTB.
Changes in ActivePivot
In order for ActivePivot to work with Limits, Accelerators need to add the following:
Include the dependencies in the pom.xml
For the LevelPath restful endpoint:
<dependency>
<groupId>com.activeviam.apps</groupId>
<artifactId>services</artifactId>
<version>1.11.0-AP5.10</version>
</dependency>
LookupPostProcessor:
Depending on the AP version your ActivePivot, import the appropriate artifact according. For AP 5.9, AP 5.10 and AP 5.11:
<dependency>
<groupId>com.activeviam.limits</groupId>
<artifactId>lookup-post-processor-ap59</artifactId>
<version>{LIMIT MODULE VERSION}</version>
</dependency>
<dependency>
<groupId>com.activeviam.limits</groupId>
<artifactId>lookup-post-processor-ap510</artifactId>
<version>{LIMIT MODULE VERSION}</version>
</dependency>
<dependency>
<groupId>com.activeviam.limits</groupId>
<artifactId>lookup-post-processor-ap511</artifactId>
<version>{LIMIT MODULE VERSION}</version>
</dependency>
Register the LookUpPostProcessor
The LookUpPostProcessor needs to be registered within ActivePivot inorder for ActivePivot to be able to use it. You can register the LookUpPostProcessor statically anywhere in your ActivePivot configuration with the following:
LookUpPostProcessor.addMeasureToRegistry();
Add the LevelPathRestServiceConfig
import com.activeviam.services.levelpath.LevelPathRestServiceConfig;
@Configuration
@Import(value = {
LevelPathRestServiceConfig.class
}
Startup Sequence Matters
As the Limits Module creates the KPI in the business cubes automatically, it is important to start up the business AP instances fully before starting up Limits.