# Link Process Button to Process Designer

This section explains how to **link Process Buttons in App Designer** with a **Process Flow created in Process Designer**.\
Process Buttons allow actions in the UI (such as *Submit* or *Complete*) to **trigger or continue a workflow** defined in Process Designer.

Each role in the Order Management App uses a Process Button differently depending on whether they **start** or **complete** the process.

***

### Pre‑Condition

Before proceeding, ensure that:

* A **Process Flow** has already been created in **Process Designer**
* The project and process name are available (for example, `DOC Order Request`)

***

### Submit Button to Start Flow

#### Entity: `Doc Order Request - Requester`

This button is used by the requester to **start the process flow**.

#### Step 1: Open Entity

1. From **App Designer**, search for entity\
   `Doc Order Request - Requester`
2. Click **Edit**

***

#### Step 2: Add Process Button

1. From **Button**, drag **Process Button** into the entity button area
2. The button name **SUBMIT\_VALUE** appears
3. Click the **pencil icon** to configure the button

***

#### Step 3: Configure Process Tab

In the **Process** tab:

* **Process Type**: `Process`
* **Project**: `DOC Order Request`
* **Process**: `DOC Order Request`
* **Process Action**: `Start`

Click **Load from AD** to load Business Objects.

Mapping:

* Hide attributes under **Order Request Item**
* Map:
  * `Order Request.Request Id` → `DOCOrderRequestBO.RequestId`
  * `Order Request.Requester` → `DOCOrderRequestBO.Requester`

***

#### Step 4: Configure Pre Action Tab

* Select the first radio button
* Choose method: `saveEntity()`

***

#### Step 5: Configure Other Settings Tab

* **buttonName**: `SUBMIT`
* **Page Action**: `ENTITY_INSERT`

Click **OK**

***

#### Step 6–7: Create Submit Button for Update Mode

Repeat **Steps 2–5** again, but in **Other Settings**:

* **Page Action**: `ENTITY_UPDATE`

There will be **two SUBMIT buttons**:

* One for **Insert mode**
* One for **Update mode**

***

#### Step 8: Save Entity

Click **Save this Entity**

***

### Submit Button to Complete Flow

#### Entity: `Doc Order Request - Admin`

This button is used to **complete the process** at the Admin step.

#### Steps

1. Open entity `Doc Order Request - Admin`
2. Add **Process Button**
3. Configure **Process** tab:
   * Process Type: `Process`
   * Project: `DOC Order Request`
   * Process: `DOC Order Request`
   * Process Action: `Complete`
   * Load Business Objects
   * Hide `Order Request Item`
   * Map:
     * `Request Id` → `DOCOrderRequestBO.RequestId`
     * `Requester` → `DOCOrderRequestBO.Requester`
     * `Decision` → `DOCOrderRequestBO.Decision`
4. **Pre Action** tab:
   * `saveEntity()`
5. **Other Settings** tab:
   * buttonName: `SUBMIT`
   * Page Action: `ENTITY_UPDATE`
6. Click **OK**
7. Click **Save this Entity**

***

### Submit Button to Complete Flow

#### Entity: `Doc Order Request - Back Office`

The Back Office completes the process with additional data.

#### Configuration Differences

Mapping includes:

* `Request Id`
* `Requester`
* `Decision`
* `Total Amt` → `DOCOrderRequestBO.TotalAmt`

All other settings are **the same as Admin**:

* Process Action: `Complete`
* Pre Action: `saveEntity()`
* Page Action: `ENTITY_UPDATE`

Save the entity after configuration.

***

### Submit Button to Complete Flow

#### Entity: `Doc Order Request - Authorize`

For the Authorize role:

1. Open `Doc Order Request - Authorize`
2. Repeat **exactly the same steps** as the Admin entity:
   * Process Action: `Complete`
   * Map `Request Id`, `Requester`, `Decision`
   * Pre Action: `saveEntity()`
   * Page Action: `ENTITY_UPDATE`

Save the entity.

***

### Submit Button to Complete Flow

#### Entity: `Doc Order Request - Admin PO`

Admin PO performs the final completion step.

#### Steps

1. Open entity `Doc Order Request - Admin PO`
2. Add **Process Button**
3. In **Process** tab:
   * Process Type: `Process`
   * Project: `DOC Order Request`
   * Process: `DOC Order Request`
   * Process Action: `Complete`
   * Load Business Objects
   * Hide `Order Request Item`
   * Map:
     * `Request Id`
     * `Requester`
4. **Other Settings** tab:
   * buttonName: `SUBMIT`
   * Page Action: `ENTITY_UPDATE`
5. Click **OK**
6. Click **Save this Entity**

***

### Summary

In this section, you have:

* Linked UI Process Buttons to Process Designer workflows
* Configured **Start** and **Complete** actions based on role
* Mapped screen fields to Process Business Objects
* Ensured data is saved before process execution
* Enabled end‑to‑end workflow execution across all roles

This configuration completes the **integration between App Designer and Process Designer**, allowing the **Order Management App (Web)** to function as a fully automated, role‑based workflow system.


---

# 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/app-designer/link-process-button-to-process-designer.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.
