List all methods of REST API and explain the API functionality
Start Flow (new)
This API is used to start process. When user submits an application, the server calls BPMN to start the process.
URL: http://[SERVER]:[PORT]/BPMREST/service/runtime/process/start
HTTP Method: POST
HTTP Request Header: Content-Type: application/json
HTTP Request Body: {
"processName": [String: Process name],
"appName": [String: App name],
"uniqueId": [String: Process ID],
"snapVersion": [String: Snap version],
"object":{
Process Business Object
}
}
HTTP Response Body: {
"data" : [String: Reference Instance ID],
"code" : [Long: Code value],
"timestamp" : [Long: Timestamp value],
"totalRecordCount" : [Long: Total record count]
}
Start Flow (old but still available)
This API is used to start process. When user submits an application, the server calls BPMN to start the process.
URL: http://[SERVER]:[PORT]/BPMREST/service/runtime/process/[Process Name]/start
HTTP Method: POST
HTTP Request Header: Content-Type: application/json
HTTP Request Body: {
[Object: Business Object with data]
}
HTTP Response Body: {
"data" : [String: Reference Instance ID],
"code" : [Long: Code value],
"timestamp" : [Long: Timestamp value],
"totalRecordCount" : [Long: Total record count]
}
Claim Task
This API is used to claim task. Users can find tasks that they want to work on and can claim task for specific user if it is not yet assigned to him.
URL: http://[SERVER]:[PORT]/BPMREST/service/runtime/tasks/[Task ID]/claim?user=[User Name]
HTTP Method: POST
HTTP Request Header: n/a
HTTP Request Body: n/a
HTTP Response Body: {
"data" : "",
"code" : [Long: Code value],
"timestamp" : [Long: Timestamp value],
"totalRecordCount" : [Long: Total record count]
}
Complete Task
When user claim task and work on their task is finished, process runtime provides method to complete task. Application need to acknowledge the process runtime to move to next node.
URL: http://[SERVER]:[PORT]/BPMREST/service/runtime/tasks/[Task ID]/complete?user=[User Name]
HTTP Method: POST
HTTP Request Header: Content-Type : application/json
HTTP Request Body: {
[Object: Business Object with data]
}
HTTP Response Body: {
"data" : "",
"code" : [Long: Code value],
"timestamp" : [Long: Timestamp value],
"totalRecordCount" : [Long: Total record count]
}
Get Task By Instance ID
This API returns an array list of all active task information not including the business object in the process instance by referencing the instance id from method "Start Flow"
URL: http://[SERVER]:[PORT]/BPMREST/service/runtime/instance/[Instance ID]/tasks
HTTP Method: GET
HTTP Request Header: Content-Type : application/json
HTTP Request Body: N/A
HTTP Response Body: {
"data" : [ {
"createBy" : [String: Created by username],
"createTime" : [Long: Created timestamp],
"instanceId" : [String: Reference process instanct ID],
"parentTaskId" : [String: Reference parent task ID],
"dueDate" : [Long: Due date],
"loadlinkEntityId" : [String: Link to reference entity],
"definitionId" : [String: Reference Process definition ID],
"assignee" : [String: User Name],
"loadlinkParam" : [String: Load link parameter by default : "="],
"owner" : [String: Owner User Name],
"description" : [String: Node description],
"processName" : [String: Reference process name],
"name" : [String: Reference Node name],
"priority" : [Long: Task priority start from 1 to 99],
"id" : [String: Reference task ID]
} ],
"code" : [Long: Code value],
"timestamp" : [Long: Timestamp value],
"totalRecordCount" : [Long: Total record count]
}
Get Task By User/Role
URL: http://[SERVER]:[PORT]/BPMREST/service/runtime/tasks?[group/role/user]=[User Name/Role Name/Group Name]
HTTP Method: GET
HTTP Request Header: Content-Type : application/json
HTTP Request Body: N/A
HTTP Response Body: {
"data" : [ {
"createBy" : [String: Created by username],
"createTime" : [Long: Created timestamp],
"instanceId" : [String: Reference process instanct ID],
"parentTaskId" : [String: Reference parent task ID],
"dueDate" : [Long: Due date],
"loadlinkEntityId" : [String: Link to reference entity],
"definitionId" : [String: Reference Process definition ID],
"assignee" : [String: User Name],
"loadlinkParam" : [String: Load link parameter by default : "="],
"owner" : [String: Owner User Name],
"description" : [String: Node description],
"processName" : [String: Reference process name],
"name" : [String: Reference Node name],
"priority" : [Long: Task priority start from 1 to 99],
"id" : [String: Reference task ID]
} ],
"code" : [Long: Code value],
"timestamp" : [Long: Timestamp value],
"totalRecordCount" : [Long: Total record count]
}
Get Task Variables
This API returns business object variable from process runtime.
URL: http://[SERVER]:[PORT]/BPMREST/service/runtime/tasks/[Task ID]/variables
HTTP Method: GET
HTTP Request Header: N/A
HTTP Request Body: N/A
HTTP Response Body: {
"data" : {[Object: Business Object with data]},
"code" : [Long: Code value],
"timestamp" : [Long: Timestamp value],
"totalRecordCount" : [Long: Total record count]
}
Assign Task(by users)
This API is used to set candidates to task. API provides parameter list incase more then one candidate is applicable for a single task.
URL: http://[SERVER]:[PORT]/BPMREST/service/runtime/tasks/[Task ID]/assign?user=[User Name]&user=[User Name1]..&user=[User Name n]
HTTP Method: POST
HTTP Request Header: N/A
HTTP Request Body: N/A
HTTP Response Body: {
"data" : "",
"code" : [Long: Code value],
"timestamp" : [Long: Timestamp value],
"totalRecordCount" : [Long: Total record count]
}
Refresh Cache
This API is used to refresh the cache for all process in the server.
URL: http://[SERVER]:[PORT]/BPMREST/service/runtime/refreshCache
HTTP Method: POST
HTTP Request Header: N/A
HTTP Request Body: {
"process":[],
"event":"generate"
}
HTTP Response Body: {
"data" :"",
"code" : [Long: Code value],
"timestamp" : [Long: Timestamp value],
"totalRecordCount" : [Long: Total record count]
}
Class Action
This API is used to refresh the cache for a specific process or generate BO. Only the parameters related to that particular process will be updated.
URL: http://[SERVER]:[PORT]/BPMREST/service/runtime/classAction
HTTP Method: POST
HTTP Request Header: N/A
HTTP Request Body: {
"process":[{uniqueID.appName.processName.snapVersion}],
"event":"generate"
}
HTTP Response Body: {
"data" :"",
"code" : [Long: Code value],
"timestamp" : [Long: Timestamp value],
"totalRecordCount" : [Long: Total record count]
}
Last updated