> For the complete documentation index, see [llms.txt](https://docs.oneweb.tech/oneweb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.oneweb.tech/oneweb/design-and-develop-oneweb-apps/integration-with-other-systems/process-runtime-rest-api/sample-use-cases-for-process-api.md).

# Sample use cases for Process API

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.

![](/files/XAc19Az34EbnFsHV0HBA)

**Step 1: Start flow** \
Send parameter object to start flow, in this case is RoomObject and CustomerInfo.

![](/files/wHO5XUTkCodTLGIvzcAp)

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.

![](/files/bSLjRIfwM8VIYLcDBNAA)

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>"

![](/files/XRyeeRNBYwnkEUpgfgEI)

After task is assigned, data will be displayed in the To Do List of the user (Origcmr4). (See picture below)

![](/files/ennkAxorL971D6vWiGbr)

{% hint style="info" %}
**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>"
{% endhint %}

**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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.oneweb.tech/oneweb/design-and-develop-oneweb-apps/integration-with-other-systems/process-runtime-rest-api/sample-use-cases-for-process-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
