The following scenario simulates a simple leave approval business process, in which an employee fills a form and submits the leave request to the manager and the manager approves or rejects it.
Tip | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Before you begin,
|
Let's get started! This tutorial includes the following sections:
...
- Download the pre-packaged project and extract it to a preferred location. This contains the artifacts of the Configuring the Start Event to Submit Data tutorial.
- Open the WSO2 Integration Studio.
- Click File, and click Import.
- Expand the WSO2 category, select Existing WSO2 Projects into workspace and click Next.
- Click Browse, select the file you extracted and upload it.
- In the Package Explorer, double click on the name of the BPMN diagram to view the BPMN artifacts you imported.
Creating new artifacts
...
- Right click on the connection arrow, which connects the Start Event and the End Event and click Delete.
- Drag and drop a User Task to the diagram.
- Hover your mouse pointer over the Start Event, and click on the arrow icon (i.e., the Create Connection option) and connect the Start Event to the User Task.
- Hover your mouse pointer over the User Task, and click on the arrow icon (i.e., the Create Connection option) and connect the User Task to the End Event.
- Click on the User Task, and change the value of the Name field to
Review leave request
in the General section of the Properties tab.
Click on the User Task, click New in the Form section of the Properties tab and add the following field.
id Name Type Readable Writable Required Form Values vacationApproved Do you approve this vacation request? enum
Tip For fields of type “enum” you can add form values that act as different options. You can provide two options as Approve and Reject for this field.
true true true Id: true
Name: Approve Id: false Name: Reject To add an assignee to the User Task, enter the value as
manager
for the Assignee field in the Main Config section of the Properties tab (of the User Task).Tip This assumes that a single person (e.g., HR Manager) is responsible for approving or rejecting leave. If you want to allow a group of people (e.g., anyone in the HR Department) to approve/reject leave, you can enter the group role name (e.g.,
hrDepartment
) as the value of the Candidate group field in the Main Config section of the Properties tab (of the User Task).Press Ctrl+S to save Save all the artifacts , which that you created in WSO2 EI ToolingIntegration Studio.
The model is now complete as the necessary logic has been applied.
...
Start the Business Process profile of WSO2 EI.
Panel borderColor #542989 bgColor #ffffff borderWidth 1 Localtabgroup Localtab title On MacOS/Linux/CentOS Open a terminal and execute the following command:
Code Block wso2ei-6.4.0-business-process
Localtab title On Windows Go to Start Menu -> Programs -> WSO2 -> Enterprise Integrator 6.4.0 Business Process. This will open a terminal and start the business process profile.
- Log in to the BPMN-explorer at https://localhost:9445/bpmn-explorer using
admin
for both the username and password. - Click PROCESSES in the top menu, and click the Start option of the Leave Approval Process.
Initiate the process by filling the form and click Start.
You view the following message.
- Log out and log in again using
manager/manager
credentials. Click TASKS and then click MY TASKS. You view the Claimable Task, which was created by the process you started.
Click on the Task, select Approve from the drop down list and click Complete Task.
You view the Task being removed from the MY TASKS list.
Click TASKS in the top menu, and then click COMPLETED TASKS. You view the Task you just completed being added to the COMPLETED TASKS list.
...