Limit RESTful endpoints

The Limits Module provides several RESTful endpoints for developers to utilize in the AUI and ActivePivot instance communication and to customize the business logics.

Limit breach and warning evaluation

Please see the Alert On-Demand Limits Evaluation section.

Create a new limit

  • REST endpoint: /limits/rest/v1/limitDefinition/create
  • Method: POST
  • Example Endpoint: http://localhost:3090/limits/rest/v1/limitDefinition/create
  • Example body:
{
  {
    "serverName": "FRTB",
    "comment": "Limit Comment",
    "group": "Limit Group",
    "id": "id_1234",
    "name": "Limit Name",
    "validFrom": "2018-09-28",
    "validTo": "2022-01-04",
    "cubeName": "StandardisedApproachCube",
    "currency": "USD",
    "frequencyType": "official",
    "userId": "admin",
    "breachWorkflow": "Single Eye",
    "warningWorkflow": "Single Eye",
    "limitChangesWorkflow": "Single Eye",
    "breachWorkflowParameters": {
        "Examiners": "USERS"
    },
    "warningWorkflowParameters": {
        "Examiners": "USERS"
    },
    "limitChangesWorkflowParameters": {
        "Examiners": "USERS"
    },
    "measureName": "FX Risk Charge",
    "pollingFrequency": "EOD",
    "kpiType": "Less than...",
    "limitValues": [
        2
    ],
    "warningThreshold": 0.0,
    "scope": {
        "Desk": [
            "Bonds",
            "Balance Sheet Management"
        ]
    }
}
}

Upload a file of new limits

  • REST endpoint: /limits/rest/v1/limitDefinition/upload
  • Method: POST
  • Example Endpoint: http://localhost:3090/limits/rest/v1/limitDefinition/upload
  • Example body (text representation of binary file):
------WebKitFormBoundary0116TUm8HlznSV7v
Content-Disposition: form-data; name="file"; filename="<insert file name>.csv"
Content-Type: text/csv


------WebKitFormBoundary0116TUm8HlznSV7v--
  • REST endpoint: /limits/rest/v1/limitDefinition/export
  • Method: POST
  • Example Endpoint: http://localhost:3090/limits/rest/v1/limitDefinition/export
  • Example body:
{
   "orderName":"current_limits_table"
}

Check if the logged-in user can start the workflow

  • Endpoint: /limits/rest/v1/limitDefinition/canStart
  • Method: GET
  • Example Endpoint: http://localhost:3090/limits/rest/v1/limitDefinition/canStart

Expire the workflow

  • Endpoint: /limits/rest/v1/limitDefinition/expire
  • Method: POST
  • Example Endpoint: http://localhost:3090/limits/rest/v1/limitDefinition/expire
  • Example body:
{
  "limitKeys": [
    -2061128317,
    -52040286,
    1317705186
  ],
  "asOfDate": "2018-09-28"
}

Approve the workflow

  • Endpoint: /limit-process-instance/approve
  • Method: PUT
  • Example Endpoint: http://localhost:3090/limit-process-instance/approve
  • Example body:
{
    "definitionName": "GIRR Risk Charge Demo",
    "exportStatusDetails": null,
    "comment": null,
    "serverName": "FRTB",
    "asOfDate": [
        2018,
        9,
        28
    ]
}

Workflow Audit History

Breach Management History

  • Endpoint: limit-process-instance/process-instance-history/{key}::EXCEPTION
  • Method: GET
  • Example Endpoint: limit-process-instance/process-instance-history/-1749471693::EXCEPTION
  • Example body:
{
[
  {
    "type": "com.activeviam.limits.workflow.model.instance.dto.LimitsProcessInstanceDTO",
    "object": {
      "workflowType": null,
      "workflowParameters": null,
      "category": null,
      "asOfDate": "2018-09-28",
      "definitionName": "-1749471693",
      "status": null,
      "user": null,
      "comment": null,
      "limitDefinitionDto": {
        "group": "Operational Limits",
        "id": "p.1.2 of RAF",
        "name": "Equity Vega Limits",
        "comment": "Structuring",
        "validFrom": "2018-09-26",
        "validTo": null,
        "frequencyType": "OFFICIAL",
        "pollingFrequency": "INTRADAY",
        "currency": "USD",
        "kpiType": "Greater Than",
        "limitValues": [
          200000.0
        ],
        "absoluteValueInd": true,
        "warningThreshold": 80,
        "measureName": "Equity Vega Sensitivities",
        "precedence": 0,
        "scope": {
          "Risk Measure@Risk Measures@Risk": [
            "Vega"
          ],
          "Equity Market Cap Category@Equity Market Cap Category@Market Data": [
            "Small"
          ],
          "Risk Factor@Risk Factors@Risk": [
            "*"
          ],
          "Desk@Desks@Booking": [
            "Structuring"
          ]
        },
        "scopeArray": null,
        "limitStatus": "APPROVED",
        "exceptionWorkflow": "Exception",
        "limitChangesWorkflow": "StraightThrough",
        "limitChangesWorkflowParameters": null,
        "userId": "user1",
        "cubeName": "StandardisedApproachCube",
        "serverName": "FRTB",
        "systemState": "N/A",
        "timeStamp": [
          2022,
          10,
          5,
          15,
          17,
          22,
          261541000
        ],
        "exceptionStatus": "N/A",
        "exceptionComment": "N/A",
        "exceptionCategory": "N/A",
        "hashKey": -1749471693,
        "draftLimitStatus": "N/A"
      },
      "exceptionCategory": null,
      "exceptionComment": null,
      "type": "EXCEPTION",
      "limitsKey": -1749471693
    },
    "key": "-1749471693::EXCEPTION",
    "timestamp": 1664997493.325000000,
    "status": "BREACHED",
    "user": "admin",
    "comment": "",
    "processDefinitionName": "limit-process-instance.exception",
    "action": "EVALUATE"
  },
  {
    "type": "com.activeviam.limits.workflow.model.instance.dto.LimitsProcessInstanceDTO",
    "object": {
      "workflowType": "Exception",
      "workflowParameters": null,
      "category": null,
      "asOfDate": "2018-09-28",
      "definitionName": "-1749471693",
      "status": null,
      "user": null,
      "comment": null,
      "limitDefinitionDto": {
        "group": "Operational Limits",
        "id": "p.1.2 of RAF",
        "name": "Equity Vega Limits",
        "comment": "Structuring",
        "validFrom": "2018-09-26",
        "validTo": null,
        "frequencyType": "OFFICIAL",
        "pollingFrequency": "INTRADAY",
        "currency": "USD",
        "kpiType": "Greater Than",
        "limitValues": [
          200000.0
        ],
        "absoluteValueInd": true,
        "warningThreshold": 80,
        "measureName": "Equity Vega Sensitivities",
        "precedence": 0,
        "scope": {
          "Risk Measure@Risk Measures@Risk": [
            "Vega"
          ],
          "Equity Market Cap Category@Equity Market Cap Category@Market Data": [
            "Small"
          ],
          "Risk Factor@Risk Factors@Risk": [
            "*"
          ],
          "Desk@Desks@Booking": [
            "Structuring"
          ]
        },
        "scopeArray": null,
        "limitStatus": "APPROVED",
        "exceptionWorkflow": "Exception",
        "limitChangesWorkflow": "StraightThrough",
        "limitChangesWorkflowParameters": null,
        "userId": "user1",
        "cubeName": "StandardisedApproachCube",
        "serverName": "FRTB",
        "systemState": "N/A",
        "timeStamp": [
          2022,
          10,
          5,
          15,
          17,
          22,
          261541000
        ],
        "exceptionStatus": "BREACHED",
        "exceptionComment": "N/A",
        "exceptionCategory": "N/A",
        "hashKey": -1749471693,
        "draftLimitStatus": "N/A"
      },
      "exceptionCategory": null,
      "exceptionComment": null,
      "type": "EXCEPTION",
      "limitsKey": -1749471693
    },
    "key": "-1749471693::EXCEPTION",
    "timestamp": 1664997544.953981000,
    "status": "BREACHED",
    "user": "admin",
    "comment": "",
    "taskName": "BREACHED",
    "action": "EVALUATE"
  },
]

}

Limits Definition Management History

  • Endpoint: limit-process-instance/process-instance-history/{key}::CREATION
  • Method: GET
  • Example Endpoint: limit-process-instance/process-instance-history/-174947169::CREATION
  • Example body:
{
[
  {
    "type": "com.activeviam.limits.workflow.model.instance.dto.LimitsProcessInstanceDTO",
    "object": {
      "workflowType": "StraightThrough",
      "workflowParameters": {},
      "category": null,
      "asOfDate": "2018-09-28",
      "definitionName": "-1749471693",
      "status": "APPROVED",
      "user": null,
      "comment": null,
      "limitDefinitionDto": {
        "group": "Operational Limits",
        "id": "p.1.2 of RAF",
        "name": "Equity Vega Limits",
        "comment": "Structuring",
        "validFrom": "2018-09-26",
        "validTo": null,
        "frequencyType": "OFFICIAL",
        "pollingFrequency": "INTRADAY",
        "currency": "USD",
        "kpiType": "Greater Than",
        "limitValues": [
          200000.0
        ],
        "absoluteValueInd": true,
        "warningThreshold": 80,
        "measureName": "Equity Vega Sensitivities",
        "precedence": 0,
        "scope": {
          "Risk Measure@Risk Measures@Risk": [
            "Vega"
          ],
          "Equity Market Cap Category@Equity Market Cap Category@Market Data": [
            "Small"
          ],
          "Risk Factor@Risk Factors@Risk": [
            "*"
          ],
          "Desk@Desks@Booking": [
            "Structuring"
          ]
        },
        "scopeArray": null,
        "limitStatus": "APPROVED",
        "exceptionWorkflow": "Exception",
        "limitChangesWorkflow": "StraightThrough",
        "limitChangesWorkflowParameters": null,
        "userId": "user1",
        "cubeName": "StandardisedApproachCube",
        "serverName": "FRTB",
        "systemState": "N/A",
        "timeStamp": [
          2022,
          10,
          5,
          15,
          17,
          22,
          261541000
        ],
        "exceptionStatus": "N/A",
        "exceptionComment": "N/A",
        "exceptionCategory": "N/A",
        "hashKey": -1749471693,
        "draftLimitStatus": "N/A"
      },
      "exceptionCategory": null,
      "exceptionComment": null,
      "type": "CREATION",
      "limitsKey": -1749471693
    },
    "key": "-1749471693::CREATION",
    "timestamp": 1664997446.178000000,
    "status": "APPROVED",
    "user": "admin",
    "comment": null,
    "processDefinitionName": "limit-process-instance.straight-through",
    "action": "UPLOAD"
  }
]

}

Display decision buttons for a given limit’s status

  • Endpoint: /limit-process-instance/getWorkflowUIActions
  • Method: GET
  • Example Endpoint: http://localhost:3090/limit-process-instance/getWorkflowUIActions?limitKey=<limit's hash key>

Executing workflow from decision button

  • Endpoint: /limit-process-instance/executeWorkflow
  • Method: PUT
  • Example Endpoint: http://localhost:3090/limit-process-instance/executeWorkflow
  • Example body:
{
    "workflowKey": "APPROVED",
    "limitKey": -284478855
}