AlertTaskManager

The AlertTaskManager orchestrates the status checks of limits.

When a breach or warning is detected, the Incidents Store is populated, the incident workflow is updated and an incident*.csv file is generated. For details on the incident*.csv file, see Incidents file

The AlertTaskManager automatically schedules future evaluations for KPIs that contain limit structures with an Intraday polling frequency. You can configure the Intraday polling frequency using the sample-rate-cron property values.

Properties

Property Value Description
task-scheduler-thread-pool-size 4 Thread pool size for the task scheduler.
sample-rate-cron 0 */5 * * * * Cron expression for the Intraday Alert task’s cron job.

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 with the task-scheduler-thread-pool-size property value. The default value is 4 threads.

The AlertTaskManager maintains a Hashmap of future AlertTasks, which are keyed on KpiTaskKeys containing fields for serverName, cubeName, kpiName, and pollingFrequency.

When Alert tasks are scheduled, they are added to the futureAlertTasks map. This allows us to unschedule tasks if needed.

REST

Evaluation REST endpoints are available for:

On-demand limit evaluation

For any of the following endpoints that use an asOfDate query parameter, note that the asOfDate is optional. They are included in the examples to demonstrate the syntax, but if not provided, Atoti Limits defaults to the date provided in the as_of_date.csv file. The result of each response is a list of strings which corresponds to an incident*.csv file, with the first string being the header.

note

Triggering an evaluation populates the incidents store and creates or updates the workflow of the resulting incident.

At the limit level

For evaluation on a per-limit basis, the following two REST endpoints can be used:

Evaluate a single limit
  • Endpoint: /limits/rest/v2/limitEvaluation/limit/evaluate/{limitKey}
  • Method: Post
  • Example Endpoint: http://localhost:3090/limits/rest/v2/limitEvaluation/limit/evaluate/12345678?asOfDate=2023-01-31
Evaluate multiple limits

note

The limit keys provided do not need to belong to the same limit structure.

  • Endpoint: /limits/rest/v2/limitEvaluation/limit/evaluate
  • Method: Post
  • Example Endpoint: http://localhost:3090/limits/rest/v2/limitEvaluation/limit/evaluate?asOfDate=2023-01-31
  • Example Request Body (the limit keys):
[
  12345678,
  -87654321
]

At the limit structure level

To evaluate on a per-limit structure basis, the following two REST endpoints can be used:

Evaluate a single limit structure
  • Endpoint: /limits/rest/v2/limitEvaluation/structure/evaluate/{limitStructureKey}
  • Method: Post
  • Example Endpoint: http://localhost:3090/limits/rest/v2/limitEvaluation/structure/evaluate/12345678?asOfDate=2023-01-31
Evaluate multiple limit structures
  • Endpoint: /limits/rest/v2/limitEvaluation/structure/evaluate
  • Method: Post
  • Example Endpoint: http://localhost:3090/limits/rest/v2/limitEvaluation/structure/evaluate?asOfDate=2023-01-31
  • Example Request Body (the limit structure keys):
[
  12345678,
  -87654321
]
Evaluate by KPI

This is equivalent to evaluation per limit structure. To evaluate a KPI against the business cubes, use the following REST endpoint:

  • Endpoint: /limits/rest/v2/limitEvaluation
  • Method: Post
  • Example Endpoint: http://localhost:3090/limits/rest/v2/limitEvaluation/evaluate
  • Example Request Body:
{
    "kpiName":"SA Book Limit",
    "cubeName":"StandardisedApproachCube",
    "serverName":"FRTB"
}

At the application level

This endpoint evaluates all approved limits:

  • Endpoint: http://localhost:3090/limits/rest/v2/limitEvaluation/evaluate/all
  • Method: Post
  • Example Endpoint: http://localhost:3090/limits/rest/v2/limitEvaluation/evaluate/all

note

This endpoint is not optimized and may not be performant.

Unschedule tasks from the TaskScheduler

To unschedule a task from the AlertTaskManager, use the following REST endpoint:

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

Example Body:

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

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"
}