Prototyping a Workflow-Driven Application in a Day: Part 1
Join the DZone community and get the full member experience.Join For Free
It is undoubtable that today's business applications mostly involve automation of processes, whether the processes involved are simple or complicated. Examples of common processes in an organization are leave application approval, purchase and ordering, recruitment, and claim approval.
It's not just time-consuming to develop a process-oriented application from ground-up, but more than often the processes are hardcoded, which makes it inflexible and resource-intensive to cater for any changes in the process.
Open Source Generic Workflow Management System
Joget Workflow is an open source Java-based workflow management system designed to automate and manage people-driven processes. You can refer to the release announcement previously posted at Javalobby for an introduction to Joget Workflow.
In this tutorial article, we're going to explore how we can create (not develop) a simple workflow-driven leave application system, using Joget Workflow without any programming effort.
Download and Install Joget Workflow
Visit the Joget Workflow download page, and choose an installation bundle that suits your platform. The standard installation bundle is packaged with Java 6, Apache Tomcat 6.0.18 (port 8080) and MySQL 5.0.22 (3307). If you have problem starting up Joget server, it is most probably resulting from a port conflict. You may take a look at this forum topic for suggested resolution.
When Joget server is successfully started up, go to http://localhost:8080/wflow-wfweb/ in your browser, and you will be greeted with the Joget Workflow Management Console login screen. To login as default administrator, use admin/admin (username/password).
Workflow Management Cycle
Deploying and executing a process in Joget Workflow involves a 3-step cycle: design, configure and execute.
Figure 1.1: Workflow Management Cycle
Design Leave Application Approval Process using Workflow Designer
In the Workflow Management Console, go to Design Process > Design New Process.
Click the "Launch Workflow Designer" button, and the Workflow Designer will be loaded using Java Web Start (requires JRE).
In the Workflow Designer, click File > New to create a new package, and a default workflow process will be created as shown:
Figure 1.2: Default package created in Workflow Designer
From the Navigator panel on the left, edit package properties (double-click "New Package") as follows, and apply changes:
- Id: leave_application
- Name: Leave Application
Figure 1.3: Package Properties
Again, from the Navigator panel on the left, edit workflow process properties (double-click "Workflow Process") as follows, and apply changes:
- Id: leave_approval
- Name: Leave Approval Process
Figure 1.4: Workflow process properties
In a process, there must be at least one participant to perform an activity. A participant can be seen as an actor from a Use Case Diagram.
Let's assume we are going to have the following participants in this process:
- Applicant: the person who submits the leave application
- Approver: the person who approves submitted leave application
- System: performs system-executable activities, such as sending out email notification
So, based on this assumption, we're going to have three participants illustrated in this process design, each with a dedicated swim lane.
There's a default participant named "Participant" created in this default package. Now, we will rename this default participant to a more meaningful name to match the actors taking part in the leave application approval process.
Double-click on "Participant" and edit the participant properties as follows:
- Id: applicant
- Name: Applicant
- Type: Participant
Figure 1.5: Participant Properties
Now that we have a participant named "Applicant", we need 2 more participants - Approver, System.
Figure 1.6: Participant Tool
From the toolbar menu, click on Participant button, and add two more participants (swim lanes) into the process diagram.
Edit the 2nd participant as:
- Id: approver
- Name: Approver
- Type: Participant
Edit the 3rd participant as:
- Id: system
- Name: System
- Type: System
It's very important to note that for the participant that performs system-automated activities, its type must be set as System. You can stop using the Participant tool by pressing Esc key, right-click, or the Selection arrow in toolbar.
As of now, you should have a process diagram as illustrated:
Figure 1.7: Added 3 Workflow Participants - Applicant, Approver, System
In the next part of this tutorial (Part 2), we're going to define workflow activities for each participant, the transitions between them, and workflow variable.
Opinions expressed by DZone contributors are their own.