# Create Order Request Project

This section explains how to **create a Process Designer project** and design the **Order Request workflow** for the Order Management Application.

The workflow controls how an order request moves through:

* Admin
* Back Office
* Authorization (for high‑value requests)
* Admin PO\
  including approval, rejection, limit validation, and notification.

***

### Objective

By completing this section, you will learn how to:

* Create a Process Designer project
* Define Business Objects for process data exchange
* Configure Work Parties and user roles
* Design a multi‑lane workflow with decisions and conditions
* Integrate App Designer entities with process activities
* Deploy and validate the completed process

***

### Step 1: Create Process Designer Project

From **ONEWEB Process Designer**, click:

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

#### Step 1.1 – Project Name

* **Project Name**: `DOC Order Request`
* Click **Next**

***

### Step 2: Define Business Object

The Business Object is used to transfer data between process steps and UI screens.

#### Step 2.1 – Create Process Parameter (Root BO)

* Click **Process Parameter**
* Click **Add Parameter**
* **Name**: `DOCOrderRequestBO`
* Click **Submit**

***

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

Under `DOCOrderRequestBO`, add the following parameters:

| Parameter Name | Type    |
| -------------- | ------- |
| RequestId      | String  |
| Requester      | String  |
| TotalAmt       | Decimal |
| Decision       | String  |
| Email          | String  |

For each parameter:

* Click **Add Parameter**
* Enter name
* Change type if required
* Click **Submit**

***

#### Step 2.3 – Clone Business Object

* Click **Clone Business Object**
* The same structure is copied to the right side
* Click **Next**

***

### Step 3: Create Work Parties

Define roles that will participate in the process.

Create the following Work Parties:

1. **ADMIN WP**
2. **BACK OFFICE WP**
3. **AUTHORIZE WP**

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

***

### Step 4: Create Users

Assign at least **one user per Work Party**.

For each user:

* **Member Id**
* **Member Name**
* **Work Party Name**
* Click **Add**

You may use **Lookup existing member** to select existing users.

Click **Next** when finished.

***

### Step 5: Create Process

#### Step 5.1 – Process Properties

* **Process Name**: `DOC Order Request`
* Access: **Private**
* **What?**: `Add supplier`
* **Who?**: `ADMIN WP`
* Click **Finish**

***

### Step 6: Save Project

* Click **Save**
* Project **DOC Order Request** is created successfully

***

### Step 7: Create Initial Flow (Admin)

1. Drag **Start Event** into lane **ADMIN WP**
2. Connect **Start → Add supplier**

***

### Step 8: Configure “Add supplier” Activity (Admin)

#### Business Object

* Input: ✅
* Output: ✅
* Parameter: `DOCOrderRequestBO`
* Map BO ↔ BO (Input and Output)

#### Assignment Policy

* Strategy: **Round Robin**
* Work Party: **ADMIN WP**

#### Load Entity

* **Entity**: `Doc Order Request - Admin`
* **Key**: `REQUEST_ID`
* **Value**: `${DOCOrderRequestBO.RequestId}`
* Click **Save Panel**

***

### Step 9: Admin Decision Gateway

1. Drag **Exclusive Gateway**
2. Name: `Admin Decision`
3. Connect **Add supplier → Admin Decision**

#### Reject Path

* Label: `Reject`
* Condition:

  ```
  DOCOrderRequestBO.Decision == "02"
  ```

***

### Step 10: Find Email & Send Email (Reject Flow)

#### Database Activity – “Find Email”

* JNDI: `jdbc/application`
* SQL:SQLselect email from wf\_ms\_employee where employee\_id = ?\
  Show more lines
* Map:
  * Requester → employee\_id
  * email → Email

#### Java Activity – “Send Email”

* JAR: `SendEmail.jar`
* Class: `com.email.SendEmail`
* Method: `sendEmail(String requestId, String emailTo)`
* Map:
  * RequestId → requestId
  * Email → emailTo

#### End Event

* Connect **Send Email → End**

***

### Step 11: Back Office Flow

#### Create Lane

* Name: **BACK OFFICE WP**

#### Human Activity – “Back Office Process”

* Assignment: **Pull**
* Work Party: **BACK OFFICE WP**
* Entity: `Doc Order Request - Back Office`
* Key: `REQUEST_ID`
* Value: `${DOCOrderRequestBO.RequestId}`

***

### Step 12: Back Office Decision Gateway

Gateway name: **Back Office Decision**

#### Reject Path

```
DOCOrderRequestBO.Decision == "02"
```

→ Find Email

#### Approve Path

```
DOCOrderRequestBO.Decision == "01"
```

→ Validate Limit

***

### Step 13: Validate Limit Gateway

Gateway name: **Validate Limit**

#### Normal Approve

```
DOCOrderRequestBO.TotalAmt <= 40000
```

→ Purchase Order

#### Exception Approve

```
DOCOrderRequestBO.TotalAmt > 40000
```

→ Authorize Process

***

### Step 14: Admin PO Flow

#### Human Activity – “Purchase Order”

* Lane: **ADMIN WP**
* Assignment: **Pull**
* Entity: `Doc Order Request - Admin PO`
* Key: `REQUEST_ID`
* Value: `${DOCOrderRequestBO.RequestId}`

***

### Step 15: Authorize Flow

#### Lane

* Name: **AUTHORIZE WP**

#### Human Activity – “Authorize Process”

* Assignment: **Load Balance**
* Work Party: **AUTHORIZE WP**
* Entity: `Doc Order Request - Authorize`

#### Authorize Decision Gateway

* Approve → Purchase Order
* Reject → Find Email

***

### Step 16: Validate and Deploy

1. Click:

   ```
   Deploy > Only Validate
   ```

   * Must show **Validation Success**
2. Then click:

   ```
   Deploy > Quick Deploy
   ```

   * Must show **Deploy Success**

***

### Final Result

The completed process includes:

* Request submission
* Admin review
* Back Office processing
* Conditional authorization by amount
* Email notification
* Final PO handling

Final workflow should look similar to the diagram 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%252Fi9izPpG4QyoNPnYUulJ2%252Fimage.png%3Falt%3Dmedia%26token%3Da9d06038-8fe1-469c-8216-543190f8fa8c&#x26;width=768&#x26;dpr=1&#x26;quality=100&#x26;sign=4feee79e&#x26;sv=2" alt=""><figcaption></figcaption></figure>

***

### Summary

In this section, you have:

* Built a full **Order Request workflow** using Process Designer
* Defined Business Objects and Work Parties
* Integrated App Designer screens with Human Activities
* Implemented approval logic with Exclusive Gateways
* Deployed a production‑ready enterprise process

This completes the **Process Designer** chapter for the **Order Management App (Web)**.


---

# 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/oneweb-platform-th/tutorials-examples/order-management-app-web/process-designer/create-order-request-project.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.
