This section provides details on the BPMN statistics REST API and the methods used to generate the statistics in the BPMN-explorer. The following sections lists out the methods involved in retrieving statistics.
All the methods of the REST API will be invoked after the base URL.
Base URL: https://<hostname>:<port-name>/bpmn/stats/
Retrieving statistics about processes and tasks
/processTaskServices/
Method | get: /deployedProcessCount |
---|---|
Description | Get the process count of the deployed processes. |
Parameters | Header Parameter - Media types acceptable for the response. Default is JSON. |
Return Type | Deployed processes with their process count. |
Example Data | { "data": [ { "processDefinitionId": "helloWorldProcess:1:11", "deployedProcessCount": 1 }, { "processDefinitionId": "manualTaskProcess:1:15", "deployedProcessCount": 4 } ] } |
Method | get: /processStatusCount |
---|---|
Description | Get the number of process instances with various states. |
Parameters | Header Parameter - Media types acceptable for the response. Default is JSON. |
Return Type | Count of process instances in each state. States: Completed, Active, Suspended, Failed |
Example Data | { "data": [ { "count": 2, "statusOfProcessOrTask": "Completed" }, { "count": 4, "statusOfProcessOrTask": "Active" }, { "count": 0, "statusOfProcessOrTask": "Suspended" }, { "count": 0, "statusOfProcessOrTask": "Failed" } ] } |
Method | get: /taskStatusCount |
---|---|
Description | Get the number of task instances with various states. |
Parameters | Header Parameter - Media types acceptable for the response. Default is JSON. |
Return Type | Count of task instances in each state. States: Completed, Active, Suspended, Failed |
Example Data | { "data": [ { "count": 4, "statusOfProcessOrTask": "Completed" }, { "count": 4, "statusOfProcessOrTask": "Active" }, { "count": 0, "statusOfProcessOrTask": "Suspended" }, { "count": 0, "statusOfProcessOrTask": "Failed" } ] } |
Method | get: /avgDurationToCompleteProcess |
---|---|
Description | Get the average time duration of completed processes. |
Parameters | Header Parameter - Media types acceptable for the response. Default is JSON. |
Return Type | Completed processes and the average time duration for each process. |
Example Data | { "data": [ { "processDefinitionId": "helloWorldProcess:1:11", "averageTimeForCompletion": 0.26085 }, { "processDefinitionId": "manualTaskProcess:1:15", "averageTimeForCompletion": 24.555516666666666 } ] } |
Method | get: /avgTaskDurationForCompletedProcess/{pId} |
---|---|
Description | Get the average time duration of each task in a completed process. |
Parameters | pId: process Definition Id of the process (required). Header Parameter - Media types acceptable for the response. Default is JSON. |
Return Type | Completed tasks with their average time duration for each completed process. |
Example Data | Request – > /avgTaskDurationForCompletedProcess/manualTaskProcess:1:15 { "data": [ { "taskDefinitionKey": "orderConfirmed", "averageTimeForCompletion": 722751 }, { "taskDefinitionKey": "placeOrder", "averageTimeForCompletion": 4117232 }, { "taskDefinitionKey": "statusOfDelivery", "averageTimeForCompletion": 7973 } ] } |
Method | get: /taskVariation |
---|---|
Description | Get the task variation over time i.e., tasks started and completed over the months. |
Parameters | Header Parameter - Media types acceptable for the response. Default is JSON. |
Return Type | Number of tasks started and completed over the months. |
Example Data | { "data": [ { "startedInstances": 10, "completedInstances": 4, "month": "Jan" }, { "startedInstances": 6, "completedInstances": 3, "month": "Feb" }, { "startedInstances": 9, "completedInstances": 9, "month": "March" }, { "startedInstances": 2, "completedInstances": 4, "month": "April" }, { "startedInstances": 0, "completedInstances": 0, "month": "May" }, { "startedInstances": 11, "completedInstances": 7, "month": "June" }, { "startedInstances": 14, "completedInstances": 12, "month": "July" }, { "startedInstances": 4, "completedInstances": 3, "month": "Aug" }, { "startedInstances": 2, "completedInstances": 1, "month": "Sep" }, { "startedInstances": 2, "completedInstances": 2, "month": "Oct" }, { "startedInstances": 0, "completedInstances": 0, "month": "Nov" }, { "startedInstances": 10, "completedInstances": 7, "month": "Dec" } ] } |
Method | get: /processVariation |
---|---|
Description | Get the process variation over time i.e., process instances started and completed over the months. |
Parameters | Header Parameter - Media types acceptable for the response. Default is JSON. |
Return Type | Number of process instances started and completed over the months. |
Example Data | { "data": [ { "startedInstances": 3, "completedInstances": 3, "month": "Jan" }, { "startedInstances": 10, "completedInstances": 5, "month": "Feb" }, { "startedInstances": 8, "completedInstances": 6, "month": "March" }, { "startedInstances": 3, "completedInstances": 2, "month": "April" }, { "startedInstances": 14, "completedInstances": 12, "month": "May" }, { "startedInstances": 20, "completedInstances": 12, "month": "June" }, { "startedInstances": 6, "completedInstances": 3, "month": "July" }, { "startedInstances": 0, "completedInstances": 0, "month": "Aug" }, { "startedInstances": 6, "completedInstances": 1, "month": "Sep" }, { "startedInstances": 9, "completedInstances": 7, "month": "Oct" }, { "startedInstances": 11, "completedInstances": 10, "month": "Nov" }, { "startedInstances": 6, "completedInstances": 3, "month": "Dec" } ] } |
Method | get: /allProcesses |
---|---|
Description | Get all the deployed processes. |
Parameters | Header Parameter - Media types acceptable for the response. Default is JSON. |
Return Type | Deployed processes |
Example Data | { "data": [ "helloWorldProcess:1:11", "manualTaskProcess:1:15", "testProcess:1:4", "userTaskProcess:1:10" ] } |
Retrieving statistics about users
/userServices/
Method | get: /allUsers |
---|---|
Description | Get all the users from user store. |
Parameters | Header Parameter - Media types acceptable for the response. Default is JSON. |
Return Type | User list |
Example Data | { "data": [ "admin", "testClerk" ] } |
Method | get: /userVsTaskCount |
---|---|
Description | Get the number of completed tasks of the users. |
Parameters | Header Parameter - Media types acceptable for the response. Default is JSON. |
Return Type | Users with the number of tasks completed by each of them. |
Example Data | { "data": [ { "userName": "admin", "taskCount": 4 }, { "userName": "testClerk", "taskCount": 3 } ] } |
Method | get: /userVsAvgTimeDuration |
---|---|
Description | Get the average time taken by each user to complete tasks. |
Parameters | Header Parameter - Media types acceptable for the response. Default is JSON. |
Return Type | Users with the average time taken by each user to complete tasks. |
Example Data | { "data": [ { "userName": "admin", "avgTimeDuration": 372.24275 }, { "userName": "testClerk", "avgTimeDuration": 2740.863 } ] } |
Method | get: /userTaskVariation/{assignee} |
---|---|
Description | Get the task variation of each user over time i.e., tasks started and completed by each user over the months. |
Parameters | assignee: user (required). Header Parameter - Media types acceptable for the response. Default is JSON |
Return Type | Number of tasks started and completed over the months by the selected user. |
Example Data | { "data": [ { "startedInstances": 3, "completedInstances": 4, "month": "Jan" }, { "startedInstances": 10, "completedInstances": 8, "month": "Feb" }, { "startedInstances": 6, "completedInstances": 5, "month": "March" }, { "startedInstances": 4, "completedInstances": 2, "month": "April" }, { "startedInstances": 9, "completedInstances": 10, "month": "May" }, { "startedInstances": 7, "completedInstances": 6, "month": "June" }, { "startedInstances": 5, "completedInstances": 2, "month": "July" }, { "startedInstances": 0, "completedInstances": 0, "month": "Aug" }, { "startedInstances": 1, "completedInstances": 1, "month": "Sep" }, { "startedInstances": 2, "completedInstances": 2, "month": "Oct" }, { "startedInstances": 10, "completedInstances": 6, "month": "Nov" }, { "startedInstances": 5, "completedInstances": 4, "month": "Dec" } ] } |
Response Codes
Response Code | Description |
---|---|
200- Ok | Indicates that the response was found and returned. |
401- Unauthorized | The operation failed. The operation requires an Authentication header to be set. If this was present in the request, the supplied credentials are not valid or the user is not authorized to perform this operation. |
404- Not Found | Indicates the requested details was not found. |
405 - Method Not Allowed | The operation failed. The used method is not allowed for this resource. |
415 - Unsupported Media Type | The operation failed. The request body contains an unsupported media type. This also occurs when the request-body JSON contains an unknown attribute or value that does not have the right format/type to be accepted. |
500 - Internal Server Error | The operation failed. An unexpected exception occurred while executing the operation. The response-body contains details about the error. |