Skip to content

Example: Leave Application Process ​

Overview ​

This article uses a common "leave application" process as an example to introduce the overall configuration of BPMN workflows. Through this example, you will understand how workflows operate in handling leave processes. As a typical business process, the leave application process can help you better understand the practical application of BPMN workflows. We will detail the definition and configuration of the process, and explain the functions and interaction methods of each link. Let's explore the working principle of the workflow engine and its application in leave processes together.

Process Introduction ​

Suppose our leave application process is as follows: The initiator submits a leave application, which is completed after approval by the superior and administrative assistant. If the leave duration is 3 days or more, it needs to be approved by the administrative supervisor to be considered as a successful leave application.

Process Diagram ​

Based on the assumed leave application process, we have drawn the following flow chart to show the structure and flow of the process:

Process Diagram

Data Table ​

The data table structure for storing leave application form data is as follows:

FieldTypeDescription
leaveTypeList SelectionLeave Type, including: Annual Leave, Sick Leave, Personal Leave, Compensatory Leave
startDateDateLeave Start Time
endDateDateLeave End Time
reasonMulti-line TextReason for Leave
durationsFunctionLeave Duration. Specific configuration: DATE(endDate) - DATE(startDate) + 1

durations configuration:

DATE(endDate) - DATE(startDate) + 1

Workflow Configuration ​

In the Leave Application process, the initiator needs to fill out the leave application form and obtain approval from the superior and administrative assistant. If the leave duration is 3 days or more, approval from the administrative supervisor is also required. The following is the specific workflow configuration:

Global Settings ​

Add a start form for the initiator to fill in leave application information. Global Settings

Superior Approval Node ​

Directly assign user tasks to the initiator's superior by configuring the handler, defaulting to "or sign" behavior. Superior Approval

Administrative Assistant Approval Node ​

Use multi-instance to configure "or sign" behavior, with the handler set to ${adminAsitor}. Administrative Assistant Approval

Determine Leave Duration ​

Add an exclusive gateway and configure flow rules. The system determines the process flow to the eligible branch based on the flow rules. Flow Rules

Administrative Supervisor Approval Node ​

Similar to the superior approval node, select the administrative supervisor as the handler.

For the settings of all user task nodes, please refer to the following example diagram: User Task Node Settings

Effect Diagrams ​

Application Form: Form

Superior Approval Task: Superior Approval Task