# Process Designer

In a leave management system, defining **who approves**, **in what order**, and **under what conditions** is critical.\
The **Process Designer** in ONEWEB is used to create and control the **Leave Request workflow**, ensuring that each leave request follows a predefined and auditable approval process.

In the **Leave Control App**, Process Designer orchestrates the entire leave lifecycle—from request submission, through multiple approval levels, to final authorization.

***

### Purpose of Process Designer in Leave Control App

Process Designer is used to model and manage the **business workflow** of leave requests.\
It enables you to:

* Define structured leave approval processes
* Assign approval tasks to different roles
* Control approval sequence and conditions
* Handle rejection paths and process completion
* Integrate user decisions with application screens created in App Designer

Instead of handling approvals manually, the leave approval logic is **centralized, consistent, and traceable**.

***

### Leave Control Workflow Overview

A typical Leave Control workflow includes:

1. **Requester**
   * Submits a leave request
   * Starts the workflow
2. **Supervisor / PM**
   * Reviews leave details
   * Approves or rejects
3. **One Down / Head**
   * Reviews prior approval
   * Makes a higher‑level decision
4. **HR**
   * Reviews compliance and policy
   * Approves or rejects
5. **Authorize**
   * Performs final authorization
   * Completes the workflow

Each of these steps is represented as a **Human Activity** in Process Designer and is linked to a specific **App Designer entity**.

***

### Process Designer Components Used

The Leave Control App demonstrates key Process Designer components:

#### Start and End Events

* **Start Event**\
  Marks the beginning of the leave request process when a requester submits a request.
* **End Event**\
  Indicates that the leave request process has been completed or terminated.

#### Human Activities

Human Activities represent tasks performed by users, such as:

* Reviewing leave details
* Making approval or rejection decisions
* Completing an approval step

Each Human Activity is linked to a corresponding App Designer screen.

#### Gateways

Gateways are used to control process flow, including:

* Approval vs rejection paths
* Sequential approval routing
* Conditional routing based on decision values

These gateways ensure the workflow follows the correct business logic.

***

### Relationship Between Process Designer and App Designer

In the Leave Control App:

* **App Designer** is responsible for:
  * Creating leave request and approval screens
  * Capturing and displaying user input
  * Triggering process actions via Process Buttons
* **Process Designer** is responsible for:
  * Defining the approval flow
  * Assigning tasks to roles
  * Controlling process progression and completion

When a user clicks **Submit** on an App Designer screen, the action is passed to Process Designer to either **start** or **complete** a workflow task.

***

### What You Will Learn in This Section

In the following sections, you will learn how to:

* Create a Leave Request workflow in Process Designer
* Define Start and End events
* Configure approval steps using Human Activities
* Implement approval logic using Gateways
* Link Process Designer activities with App Designer entities

Each step builds toward a complete **end‑to‑end Leave Control workflow**.

***

### Summary

**Process Designer** is a core component of the **Leave Control App**, enabling structured, role‑based, and auditable leave approval flows.

By using Process Designer together with App Designer, the Leave Control App becomes a **fully process‑driven application** that supports real‑world organizational leave approval scenarios.

In the next sections, you will begin creating the **Leave Approval Workflow step by step** using **Process Designer**.


---

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