Alert Task

AlertTasks check the status of KPIs created by the Limits Accelerator to see if a breach is detected.

AlertTasks maintain information about associated limits and contain a run method that queries the appropriate Accelerator to detect a breach. When a breach is detected, a file is written to which populates AlertsDefinition Store.

AlertTasks is created automatically when Intraday polling frequency is selected. In limits.properties, Intraday observation is configured as the cron job syntax: sample-rate-minutes=* sample-rate-seconds=0

For other types of polling frequency, evaluation is triggered through the Evaluation restful endpoint.

Alert Store

The Alert Store has the same keys as the Limit store.

Field Name Key Field Description
Limit ID N Limit reference from the golden source.
Name Y Limit name used as KPI name in the business cube.
Start Date Y Effective Start Date
End Date Y Effective End Date
Polling Frequency Y Specifies how often the limits are evaluated against the business cubes.
Limit Ccy N Currency in which the value of the KPI is expressed.
Scope N This determines which members the new limit applies to. You can choose any level of the currently selected cube and a corresponding value from said level. An example scope filter is “Desk=Rates”. Multiple scope filters can be added to a single limit definition. Every scope filter is separated by a pipe.
Breach or Warning N A breach or warning is created during the evaluation.
Measure Value N The value of the measure which is breaching the limit.
KPI Type N The KPI type, such as Greater Than, Less Than, Between, Not Between.
Limit Value N The limit value.

| Level Member | N | The Level member where the breach was detected (only when scope is wildcard). | Cube Name | Y | The business cube where the KPI is created. | Server Name |Y | The business ActivePivot instance which contains the business cube. | MDX | N | The MDX query used to detect the breach. | BreachCount | N | 1 | Evaluation Timestamp | Y | Timestamp of when the breach or warning was detected by AlertTask. | Session ID | N | Unique ID created at server startup shared by all alert store tuples.

TaskScheduler

The TaskScheduler Bean allows you to schedule AlertTasks and can be found in the ThreadPoolTaskSchedulerConfig.java class.

The quantity of threads allotted to the TaskScheduler can be configured within src/main/resources/properties/limits.properties through the property task-scheduler-thread-pool-size. The default value is 4 threads.

The TaskScheduler creates AlertTasks for every tuple added to the LimitsDefinition Store, if its Observation Frequency falls into a valid Start and End Date.

When AlertTasks are scheduled, they are added to the AlertTaskMap. This allows you to unschedule them if needed.

REST

On-Demand Limits Evaluation

To start the limits evaluation against the business cubes, use the following REST endpoint:

Endpoint: http://localhost:3090/limits/rest/v1/limitEvaluation Method: Post Example Endpoint: http://localhost:3090/limits/rest/v1/limitEvaluation/evaluate Example:

{
    "kpiName":"SA Book Limit",
    "cubeName":"StandardisedApproachCube",
    "serverName":"FRTB"
}

Example Response:

{
    "response": "Successfully evaluated against the business cubes. Please use breach count in limits cube to see the details."
}

The limits evaluation creates new data of breach and warning in the AlertsDefinition datastore, and updates the Limits workflow status to BREACH and WARNING accordingly.

Unschedule an Intraday Task

To unschedule a task, use the following REST endpoint:

Endpoint: /limits/rest/v1/limitEvaluation/unschedule Method: POST Example Endpoint: http://localhost:3090/limits/v1/rest/limitEvaluation/unschedule

Example Body:

{
   "asOfDate":"2018-09-28",
   "limitsCard":"Equity Desk Hard",
   "limitsID":"id_252394",
   "limitsCaption":"Value-at-Risk Portfolio Limit",
   "from":"2018-03-01",
   "to":"2021-03-31",
   "frequencyType":"OFFICIAL",
   "relevancy":"EOD",
   "workflowStatus":"APPROVED",
   "limitsCcy":"USD",
   "limitsValue":"2000",
   "limitsName":"Delta",
   "scope":"Desk=Bonds",
   "userID":"Sheila from Risk Control",
   "cubeName":"Sensitivity Cube"
}

Example Response:

{
  "response": "Successfully processed unscheduling task with key : 2018-09-28Equity Desk Hardid_252394Value-at-Risk Portfolio Limit2018-03-012021-03-31OFFICIALEODAPPROVEDUSD2000DeltaDesk=BondsSheila from Risk ControlSensitivity Cube"
}
search.js