# Create Process Leave Request

This section explains how to **create the Leave Request workflow** using **Process Designer**.\
The process defines how a leave request flows through **Requester → PM / Supervisor → One Down / Head → HR → Authorize** using **Parallel Gateways**.

***

### Objective

By completing this section, you will learn how to:

* Create a Process Designer project for Leave Control App
* Define Business Objects for process data
* Configure lanes for each approval role
* Use Parallel Gateways to manage approval flow
* Link Human Activities to App Designer entities
* Deploy the complete Leave Request process

***

### Step 1: Create Process Designer Project

From **ONEWEB Process Designer**, click:

```
Create Project > Create Project Wizard
```

#### Step 1.1 – Project Name

* **Project Name**: `Leave Request`
* Click **Next**

***

### Step 2: Define Business Object

#### Step 2.1: Create Root Business Object

1. Click **Process Parameter**
2. Click **Add Parameter**
3. **Name Parameter**: `LeaveRequest`
4. Click **Submit**

***

#### Step 2.2: Add Parameters to Business Object

Under `LeaveRequest`, add the following parameters:

| Parameter Name | Type   |
| -------------- | ------ |
| request\_id    | String |
| requester      | String |
| request\_type  | String |

After adding all parameters:

1. Click **Clone Business Object** (copy to right side)
2. Click **Next**

***

### Step 3: Create Work Parties

Create the following Work Parties:

1. `Requester`
2. `PM / Supervisor`
3. `One down / Head`
4. `HR`
5. `Authorize`

Click **Add** after each one, then click **Next**.

***

### Step 4: Create Users

For each Work Party:

1. Enter **Member Id**
2. Enter **Member Name**
3. Select **Member Type** = `USER`
4. Assign **Work Party Name**
5. Click **Add**

> All Work Parties must have at least 1 user.

Click **Next**.

***

### Step 5: Create Process

* **Process Name**: `Leave Request`
* Access: **Private**
* Click **Finish**

Click **Save**, confirm **Yes**, and close when status shows success.

***

### Step 6: Create Lanes and Start / End

#### Requester Lane

1. Add **Horizontal Lane**
2. Rename to `Requester`

#### Add Events

* Drag **Start Event** to Requester lane
* Drag **End Event** to Requester lane

***

### Step 7: Create Parallel Gateways

1. Drag **Parallel Gateway** → rename to `Parallel1`
2. Drag another **Parallel Gateway** → rename to `Parallel2`

Connect:

* `Start → Parallel1`
* `Parallel2 → End`

***

### Step 8: PM / Supervisor Activity

#### Create Lane

* Name: `PM / Supervisor`

#### Create Human Activity

* Name: `PM / Supervisor`
* Business Object:
  * Input + Output = `LeaveRequest`
  * Map BO → BO
* Assignment Policy:
  * Type: `Pull`
  * Work Party: `PM / Supervisor`
* Load Entity:
  * Entity: `Doc Leave Request Supervisor PM`
  * Key: `REQUEST_ID`
  * Value: `${LeaveRequestBO.request_id}`

Connect:

* `Parallel1 → PM / Supervisor → Parallel2`

***

### Step 9: One Down / Head Activity

#### Create Lane

* Name: `One down / Head`

#### Create Human Activity

* Name: `One down / Head`
* Assignment: `Pull`
* Work Party: `One down / Head`
* Entity: `Doc Leave Request One Down Head`

Connect:

* `Parallel1 → One down / Head → Parallel2`

***

### Step 10: HR Activity

#### Create Lane

* Name: `HR`

#### Create Human Activity

* Name: `HR`
* Assignment: `Pull`
* Work Party: `HR`
* Entity: `Doc Leave Request HR`

Connect:

* `Parallel1 → HR → Parallel2`

***

### Step 11: Authorize Activity

#### Create Lane

* Name: `Authorize`

#### Create Human Activity

* Name: `Authorize`
* Assignment: `Pull`
* Work Party: `Authorize`
* Entity: `Doc Leave Request Authorize`

Connect:

* `Parallel1 → Authorize → Parallel2`

***

### Step 12: Finalize and Deploy

1. Click **Save**
2. Click **Choose Deploy > Deploy**

***

### Final Result

The completed **Leave Request Process Flow** will appear as shown below:

<figure><img src="https://docs.oneweb.tech/oneweb/~gitbook/image?url=https%3A%2F%2F2015371994-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FMpDjHWFRUtZ5nJcSfVXd%252Fuploads%252FeRGmifdxENE9yoOEeT2k%252Fimage.png%3Falt%3Dmedia%26token%3D81968181-a50b-4433-9ece-e0220f24b0f0&#x26;width=768&#x26;dpr=1&#x26;quality=100&#x26;sign=937a6bbe&#x26;sv=2" alt=""><figcaption></figcaption></figure>

***

### Summary

In this section, you have:

* Created a Leave Request Process Designer project
* Defined Business Objects and Work Parties
* Designed a parallel approval workflow
* Linked each Human Activity to App Designer entities
* Successfully deployed the Leave Request process

This completes the **Process Designer configuration** for the **Leave Control App**.


---

# Agent Instructions: 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:

```
GET https://docs.onewebstack.com/tutorials-examples/leave-control-app/process-designer/create-process-leave-request.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
