Introduction
This tutorial will explain step by step how to create a simple Business Process Model. First the process to be modeled is introduced and explained, then you'll see how to realize it with WebRatio.
The Vacation Request Process
The process of Vacations Request starts when any employee of the organization submits a vacation request, once the requirement is registered, the request is received by the immediate supervisor of the employee requesting the vacation, the supervisor must approve or reject the request, if the request is rejected the application is returned to the applicant/employee who can review the rejection reasons. If the request is approved a notification is generated to the Human Resources Representative, who must complete the respective management procedures. This process focuses in controlling the requests of Vacations of the organization, from the initial request up to its approval or rejection.
Step 1: Define the process
According to the BPMN notation, the first step is to define the process and the actors the cooperate in it. After this step it's necessary to define the tasks accomplished by each actor in the process.
If you're not in the BPM Perspective, select Window > Open Perspective > BPM from the main menu.
Open BPM Perspective
1. Let's create a new Project. This project will contain all the process models we would like to cooperate. In the Main Menu:
- Click on File > New > BPM Project.
- Enter "Example Project" as project name and press Finish.
Create the New "Example" Project
2. Now it's possible to create a new Process Model within the Project. In the BPM Explorer View:
- Right-click on the project and select New > Process.
- Enter "VacationRequest" (avoiding spaces) as process name.
- Press Finish.
Create a new Process Model
3. In the Process Model created you will define the representation of the process of the Vacation Request using the BPMN. By default every new Process Model is created with a Pool already defined. We have to change it's name according to our process:
- Double-click on the Pool tab "Pool 1" at the top of the edit area.
- Enter "Vacation Request" as Pool name.
Change Pool name
4. The Pool is already created with a Lane within. It's necessary to change the name to the first Lane and add all the other Lanes of the process.To change the Lane name:
- Double-click on the Lane tab "Lane 1" at the left of the edit area.
- Enter "Employee" as Lane name.
Change Lane name
To add the other Lanes:
- Right-click within the Pool and select Add Lane.
- Enter the name of the Lane.
Add a Lane to the Process
according to our process we have to create the "Supervisor" and the "Human Resources Assistant" Lanes.
Add all the Lanes to the Process
5. Now it's possible to define the single steps of the process in the Lanes, assigning each task to the right actor. Within the first Lane a simple process has been already created. Since the process is started by the Employee we can leave the Start Event in the Employee Lane and change the name of the first Task:
- Double-click on the Task element.
- Enter "Register Vacation Request" as Task name.
Since the Start Event represents the first item activated by the Employee to start the Process, it's necessary to change it's name:
- Double-click on the Start Event element.
- Enter "New Vacation Request" as Task name.
Finally, since the process doesn't ends here, it's necessary to delete the End Event automatically created.
Change the name of the Task and of the Start Event. Delete the End Event
6. The following step consists on a test of the availability of the vacation days executed by the application. To accomplish this we need to define an automatic procedure that given the Vacation Request will state if the vacations days are available or not for that Employee (eventually connecting to the Information System). To represent this automatic procedure we need a Service Task:
- Click on the "Register Vacation Request" Task.
- In the Pie Menu on the Task, click on the User Task icon.
- Drag the new User Task in the Supervisor Lane.
- Enter "Verify Available Vacation Days" as Task name.
- In the Task Properties Panel, select Service for the Execution Property (since this is an automatic procedure performed by the application).
Add a Service Task
7. Basing on the result of the automatic procedure, we will define a different path to be followed whether the vacation days are available or not, therefore we will use a Gateway element. To add a Gateway connected to the "Register Vacation Request" Task:
- Click on the "Verify Available Vacation Days" Task.
- In the Pie Menu on the Task, click on the Exclusive Gateway icon.
- Drag the new Gateway in the Supervisor Lane.
- Enter "Verify Days Availability" as Gateway name.
- In the Properties panel, in the Execution Property, select "Service" (since this element must be executed by the application).
Add a Service Exclusive Gateway
8. Once the Gateway has been placed, it's necessary to place the Flow Connectors representing the paths selected basing on the condition to be evaluated by the Gateway. Since this Gateway will evaluate the result of the execution of the "Verify Available Vacation Days" Task, it's necessary to add two Flow Connectors: one in case the vacation days are available and one in case the vacation days are unavailable. The former will activate a new Task for the approval of the vacation, the latter will re-activate the "Register Vacation Request" Task. Let's add the Flow Connector for the case in which the vacation days are available, we will simultaneously create the Task for the Supervisor approvation of the vacation:
- Click on the "Verify Available Vacation Days" Gateway element.
- In the Pie Menu on the Gateway, click on the User Task icon.
- Drag the new User Task in the Supervisor Lane.
- Enter "Approve Vacation Days" as Task name.
- Double-click on the newly created Flow Connector.
- Enter "Days Available" as Flow Connector name.
- In the Flow Connector Properties Panel check the Default Property (stating that this is the Connector followed by default).
Add a Flow Connector representing the case in which the vacation days are available
Let's add the Flow Connector for the case in which the vacation days are not available:
- click on the "Verify Available Vacation Days" Gateway element
- in the Pie Menu on the Gateway, click on the Flow Connector icon
- drag the new Flow Connector to "Register Vacation Request" Task
- double-click on the newly created Flow Connector
- enter "Days Not Available" as Flow Connector name
Add a Flow Connector representing the case in which the vacation days are not available
9. The approvation of the Supervisor must be checked by a Gateway that will define a path if the vacation has been approved and a path if the vacation hasn't been approved:
- Click on the "Approve Vacation Days" Task.
- In the Pie Menu on the Task, click on the Exclusive Gateway icon.
- Enter "Verify Approvation Vacation Days" as Gateway name.
- In the Properties panel, in the Execution Property, select "Service" (since this element must be executed by the application).
Add the "Verify Approvation Vacation Days" Exclusive Gateway
10. Once the Gateway has been placed, it's necessary to add the destination of the Flow Connectors. If the vacation days are not approved we want to notify it to the Employee, if the vacation days are approved we want to activate a Task executed by the Human Resource Assistant that manage the vacation request.
Let's define the case in which the vacation are approved:
- Click on the "Verify Approvation Vacation Days" Gateway.
- In the Pie Menu on the Gateway, click on the User Task icon.
- Drag the new User Task in the Human Resource Assistant Lane.
- Enter "Make Administrative Task" as Task name.
- Double-click on the newly created Flow Connector.
- Enter "Approved" as Flow Connector name.
Let's define the case in which the vacation are not approved:
- Click on the "Verify Approvation Vacation Days" Gateway.
- In the Pie Menu on the Gateway, click on the User Task icon.
- Drag the new User Task in the Employee Lane.
- Enter "Inform Reject Reason" as Task name.
- Double-click on the newly created Flow Connector.
- Enter "Not Approved" as Flow Connector name.
Add the "Make Administrative Task" and "Inform Reject Reason" User Tasks
11. After the execution of the "Make Administrative Task" Task the process ends. It's necessary to add an End Event that states the end of the process:
- Click on the "Make Administrative Task" Task.
- In the Pie Menu on the Task, click on the End Event icon.
- Drag the new End Event in the Employee Lane.
- Enter "Vacation Request End" as End Event name.
Add the End Event
12. After the execution of the "Inform Reject Reason" Task the process ends. It's necessary to add a Flow Connector from the Task to the "Vacation Request End" End Event:
- Click on the "Inform Reject Reason" Task.
- In the Pie Menu on the Task, click on the Flow Connector icon.
- Drag the new Flow Connector to the "Vacation Request End" End Event.
Complete Process Representation
Step 2: Process Data
Once the steps of the process have been entirely defined we can focus on the definition of the parameters of the process. Here we will define the internal structure of every parameter, if it's a simple parameter or a complex one (in this case we will create a Business Object). In this phase we will also define which process parameters are managed by every single Element in the process (Task, Event, Gateway). The first process parameter to define is the vacation request parameter. The vacation request is composed by multiple properties such as the request date, the start date and the end date. Since the vacation request is a complex parameter we must define a Business Object:
- In the BPM Explorer view, right-click on the Business Objects project element.
- Select New -> Business Object.
- Enter "VacationRequest.bo" as Business Object name.
Create the Vacation Request Business Object
In the "VacationRequest" Business Object window, we will insert all the properties that define a vacation request:
- Request Date: contains the date in which the request is created.
- Start Date: contains the start date of the vacation.
- End Date: contains the end date of the vacation.
- Notes: contains notes added by the Employee.
Let's add all the properties to the Vacation Request Business Object. In the VacationRequest Business Object widow, for every property:
- Press on the "Add" button.
- In the "Property Name" field enter the name of the property.
- In the "type" field select the type of the property.
as an example:
- Press on tha "Add" button.
- In the "Property Name" field enter "Request Date".
- In the "type" field select"date".
Add the properties to the Vacation Request Business Object
Once the Vacation Request Business Object has been defined, it's possible to use it as process parameter:
- Press on the Edit Process Parameters icon next to the Pool name.
- In the Edit Process Parameters window click on the "Add" button.
- Enter Vacation Request as parameter name.
- Press on the Business Object icon.
- Select the VacationRequest Business Object.
Add the Vacation Request process parameter
Now it's possible to state that during the "Register Vacation Request" Task, the Employee must edit the Vacation Request parameter:
- Click on the "Register Vacation Request" Task.
- In the properties panel select the Vacation Request parameter.
- Check the properties Visible, Editable, Required.
Set the Register Vacation Request Task parameters
In the "Approve Vacation Days" task, the Supervisor will decide whether to approve or not the vacation days requested. In the Task, the Vacation Request will be Visible. It's necessary to add a new parameter, to represent the decision of the supervisor:
- Right-click on the pool.
- Select Edit Process Parameter.
- In the Edit Process Parameter windows press the "Add" button.
- Insert Approvation as parameter name.
- Insert string as parameter type.
This parameter is particular since we want the Supervisor to choose only among these two values: "Approved" or "Not Approved". In order to define statically the available parameter values:
- Click on the gray dot next to the type field.
- In the Case Values Editing window press the "Add" button.
- Insert "Approved" as value.
- Again, click the Add button.
- Insert "Not Approved" as value.
Define the Approvation parameter case values
If the Supervisor rejects the Vacation Request might want to provide reject reasons to the Employee. To do this it's necessary to define a new parameter named "Reject Reason":
- Right-click on the pool.
- Select Edit Process Parameter.
- In the Edit Process Parameter windows press the "Add" button.
- Insert Reject Reason as parameter name.
- Insert text as parameter type (since the reject reason might be a long text).
Once the new paramaters has been set, it's possible to define in the "Approve Vacation Days" the Vacation Request parameter as Visible, the Approvation parameter as Required and the Reject Reason parameter as Editable.
Set the Approve Vacation Days Task parameters
The "Inform Reject Reason" Task function is only to provide to the Employee the Reject Reason of his Vacation Request. The Task is set only with the Inform Reject Reason parameter as Visible.
Set the Inform Reject Reason Task parameters
The "Make Administrative Task" Task will simply take the Vacation Request and perform all it's needed to register the vacation days. To accomplish this the task will only have the Vacation Request as Visible.
Set the Make Administrative Task Task parameters
Step 3: Business Rule
Once all the process parameters has been defined, it's possible to define the Business Rules. In this step we will define the behaviour of the process' Gateways defining the conditions for the proceeding of the process.
The "Verify Available Vacation Days" Task will automatically evaluate the availability of the vacation days requested. According to this definition, this Service Task will evaluate the Vacation Request Parameter (wich will be set as Visible in the Activity Parameters Property). Moreover, the Service Task will provide the result of his execution in a new Process Parameter ("Availability", wich will be added to the Process Parameters and set as Visible, Editable and Required in the Activity Parameters Property, with "Available" and "Unavailable" as fixed Case Values).
The Verify Available Vacation Days Service Task Parameters
The "Verify Days Availability" Gateway will automatically evaluate the result of the "Verify Available Vacation Days" Service Task execution . If the days availability is confirmed will activate the "Approve Vacation Days" Task, else it will return to the "Register Vacation Request" Task.
The Verify Days Availability Gateway
Let's configure this Gateway:
- Click on the "Verify Available Vacation Days" Gateway.
- In the Properties Panel, in the Condition Type Property, choose Literal (since we want the Gateway to evaluate the value contained in the Availability Process Parameter).
Configure the Verify Available Vacation Days Gateway
Now we need to define the Flow Connector to be followed for each value defined for the Availability Process Parameter:
- Click on the "Verify Available Vacation Days" Gateway.
- In the Properties Panel, in the Condition Value Property, press the "Browse" button.
- Select the Availability Process Parameter in the Parameter field.
- Select the Available case value for the Flow Connector that leads to the "Approve Vacation Days" Task.
- Select the Unavailable case value for the Flow Connector that leads to the "Register Vacation Request" Task.
The "Verify Approvation" Gateway will automatically evaluate the Approvation parameter, defining which path should be followed basing on the parameter's value.
- Click on the "Verify Approvation" Gateway element.
- In the Properties panel, in the Condition type Property, select "Literal" (since the evaluation is based on the parameter's value).
Once the Gateway has been configured, we should associate to each outgoing flow connector the right parameter's value:
- Click on the "Verify Approvation" Gateway.
- In the Properties Panel, in the Condition Value Property, press the "Browse" button.
- Select the Approvation Process Parameter in the Parameter field.
- Select the Not Approved case value for the Flow Connector that leads to the "Inform Reject Reason" Task.
- Select the Approved case value for the Flow Connector that leads to the "Make Administrative Task" Task.
Configure the Verify Approvation Gateway
Step 4: Business Process Users
By defining the Process Lanes we are defining all the actor categories of a process. With the Roles we are defining the Group of users that will use the Process. A Role might correspond to several Lanes in the same Process or in different Processes (e.g.: a user belonging to the Supervisor Role might act as Supervisor in a Vacation Request Process instance, but he might start a Vacation Request Process himself, or he might act as Employee in a Expense Report Process Instance). The Roles are defined within a BPM Project (since the Roles are shared in all the Process Models contained in the BPM Project). In this project we are creating three Roles: Employee, Supervisor and Human Resource Assistant:
- Employee Role: is related to the Employee Lane in the Vacation Request Process Model.
- Supervisor Role: is related to the Superisor ane Employee Lane (since a Supervisor user might ask for vacations himself).
- Human Resource Assistant: is related to the Human Resource Assistant Lane in the Vacation Request Process Model (we assume that a Human Resource Assistant user will use a different Process for his Vacation Requests).
To add the user Roles to the Project, in the BPM Explorer window double-click on the "Roles" node, or right-click on this node, than on Open With -->Roles Editor.
Open Roles Configuration Panel
Once the Roles configuration panel has been shown it's possible to create the Roles:
- Press on the "Add" button.
- Insert the Role name.
Create the BPM Project Roles
Now we can associate the newly created Roles to the Vacation Request Process Model Lanes:
- In the Process Model click on the Employee Lane.
- In the Properties panel, click on the Roles Property Select Roles button.
- Choose the Employee and the Supervisor Roles.
Define the Roles that can act as Employee in the Vacation Request Process Model
It's possible to repeat this steps to associate the Supervisor Role to the Supervisor Lane and the Human Resource Assistant Role to the Human Resource Assistant Lane.
Step 5: Publish the Process
Now we have completely defined the process. It's possible to validate the process model by activating the Publish Process functionality.
This functionality will automatically create a Java Web Application that supports the process modeled and permits to verify the model correctness browsing it