Custom App is an external application following business of company which is developed outside the ONEWEB platform. It can call the Process Runtime using the Process REST APIs to control the process.
So from a Custom App, developer can use Ajax to call the Rest Services. Example of how to use the APIs is given below.
Example method control process This picture below is a process for "Booking Room". It starts the flow with choosing the room and then checking booking status. If the room is booked, then back to choose a new room. Else if the room is not booked, add details of customer into it and then save to database and update room status.
Step 1: Start flow Send parameter object to start flow, in this case is RoomObject and CustomerInfo.
Once the flow is started, system will return the instance id to control next step of process. In this case, instance id is "122056879-85735849-0b71-4299-9cd2-165f5b31c12e".
Step 2: Get task by instance id Now the developer can get task name using the instance id from first step.
For the second step, system will return the task name, task id and so on. Please see picture above.
Step 3: Assign Task (by users) Now Developer can assign the task using task id from second step with this URL below. http://192.168.0.213:8080/BPMREST/service/runtime/tasks/122056910-494baede-088f-46bb-8a24-77b049ef996c/assign?user=origcmr4"
After task is assigned, data will be displayed in the To Do List of the user (Origcmr4). (See picture below)
Note: The developer can also assign tasks by using the instance id from the first step by this url below. "http://192.168.0.213:8080/BPMREST/service/runtime/instance/122056879-85735849-0b71-4299-9cd2-165f5b31c12e/tasks/assign?user=origcmr4"
Step 4: Claim/Unclaim/Complete Task Finally, Origcmr4 can claim / unclaim or complete task by this url below.
Claim: http://192.168.0.213:8080/BPMREST/service/runtime/tasks/122056910-494baede-088f-46bb-8a24-77b049ef996c/claim?user=origcmr4 Unclaim: http://192.168.0.213:8080/BPMREST/service/runtime/tasks/122056910-494baede-088f-46bb-8a24-77b049ef996c/claim?user= Complete: http://192.168.0.213:8080/BPMREST/service/runtime/tasks/122056910-494baede-088f-46bb-8a24-77b049ef996c/complete?user=origcmr4
After Completing Task, the process will go to the next node. Thus it will continue with the process following the configuration of the next process activity until the end task.
Process REST API is the list of REST APIs which is used to navigate the process flow from start to finish and to communicate with each other node over the process flow. The transfer of data happens over the network, which communicates through HTTP/HTTPS protocols.
The below table show the list of REST API methods provided to control process flow. For more details please check the API Guide
Request
Description
HTTP Method
1. /BPMREST/service/runtime/process/start
To start the flow.
POST
2. /BPMREST/service/runtime/process/[Process Name]/start
Old API to start flow. It is not recommended.
POST
3. /BPMREST/service/runtime/tasks/[Task ID]/claim?user=[User Name]
To claim a task by user.
POST
4. /BPMREST/service/runtime/tasks/[Task ID]/complete?user=[User Name]
To complete a process by user.
POST
5. /BPMREST/service/runtime/instance/[Instance ID]/tasks
To get task by instance ID.
GET
6. /BPMREST/service/runtime/tasks?[group/role/user]=[User Name/Role Name/Group Name]
To get task by user or role or group name
GET
7. /BPMREST/service/runtime/tasks/[Task ID]/variables
To get Task variables
POST
8. /BPMREST/service/runtime/tasks/[Task ID]/assign?user=[User Name]&user=[User Name1]..&user=[User Name n]
To assign task to user/ users
POST
9. /BPMREST/service/runtime/instance/[Instance ID]/tasks/assign?user=[User Name]
To assign instance to user
POST
10. /BPMREST/service/runtime/refreshCache
To refresh cache for all process
POST
11. /BPMREST/service/runtime/classAction
To refresh cache for a specific process
POST