Zeebe APIs¶
Introduction¶
Zeebe API is a REST API and provides functionalities related to workflow such as deploying the model, creating or cancelling process instance and more.
API documentation as Swagger¶
A detailed API description is also available as Swagger UI. Refer here to get the reference of Swagger UI.
Host URL for Optima Gateway environments will be as given below:
| Environment | {host-url} |
|---|---|
| Dev | optima-dev.optumrx.com |
| Stage | optima-stage.optumrx.com |
| Prod | optima-prod.optumrx.com |
Endpoints¶
Deploy BPMN/DMN Model¶
This API is used to deploy a BPMN or DMN model by uploading the respective .bpmn or .dmn file.
POST - https://{host-url}/gateway/zeebe/deploy-model
Request Body:
Response:
ORBulk Deploy BPMN/DMN Models¶
This API is used to deploy multiple BPMN or DMN models by uploading all the respective .bpmn or .dmn files.
POST - https://{host-url}/gateway/zeebe/bulk-deploy-models
Request Body:
Upload multiple BPMN/DMN file to deploy them altogether in the File Section as MultipleFiles header.
Response:
Model deployed: '{fileName}' with DecisionId: {decisionId}
Model deployed: '{fileName}' with ProcessId: {processId}
Create Process Instance¶
This API is used to create a new process instance of a specific BPMN model by processId, along-with optional variables.
POST - https://{host-url}/gateway/zeebe/create-process-instance/{processId}
Provide the processId in the query, which you received from the Deploy Model API Response of Zeebe Module.
Request Body:
Response:
{
"processDefinitionKey": "{processDefinitionKey}",
"bpmnProcessId": "{bpmnProcessId}",
"version": "{bpmnVersion}",
"processInstanceKey": "{processInstanceKey}",
"tenantId": "{tenantId}"
}
Cancel Process Instance¶
This API is used to cancel an existing process instance by processInstanceKey.
GET - https://{host-url}/gateway/zeebe/cancel-process-instance/{processInstanceKey}
Provide the processInstanceKey in the query, which you received from the Create Process Instance API Response of Zeebe Module.
Response:
Get Cluster Topology¶
This API is used to get the zeebe cluster topology, which gives the result regarding the zeebe broker's leaders and followers.
GET - https://{host-url}/gateway/zeebe/cluster-topology
Response:
Resolve Incident¶
This API is used to resolve any existing incident occurred in the workflow by incidentKey. This simply marks the incident as resolved; most likely a call to SetVariables will be necessary to actually resolve the problem, followed by this call.
GET - https://{host-url}/gateway/zeebe/resolve-incident/{incidentKey}
Provide the incidentKey in the query, which you received from the Search Incidents API Response of Operate Module.
Response:
Set Variables¶
This API is used to set/inject variables into the process instance by elementInstanceKey. The variables can be injected either globally (will be available for entire instance) or locally (will be available for a particular task only).
POST - https://{host-url}/gateway/zeebe/set-variables
Request Body:
{
"elementInstanceKey": 0,
"variables": {
"var1": "\"string\"",
"var2": 0,
"var3": {}
},
"local": true
}
Response:
Note
In the above Request Body, you can store variables as local or global variable.
1. For global variable => set local=false and elementInstanceKey={processInstanceKey}
2. For local variable => set local=true and elementInstanceKey={flowNodeInstanceKey}
Evaluate DMN Decision¶
This API is used to evaluate a DMN decision based on the given inputs by decisionId.
POST - https://{host-url}/gateway/zeebe/evaluate-dmn-decision/{decisionId}
Request Body:
Response: