Sunday, January 6, 2013

Leave Approval Process with Oracle BPM

(JDeveloper 11.1.1.6, WLS 10.3.6, SOA/BPM 11.1.1.6)

Following is a simple Leave Approval Process implemented in Oracle BPM.
I tried to keep the process simple and concentrated on creating a basic BPM process and how deploy and test it.
The usecase in this post is a 'Developer' requests a leave to his 'Manager' and Manager can either Approve or Reject it and Developer gets a notification of the Managers response.


Create a BPM Application

Create a BPM Process of type Manual Process

Open the BPM Project Navigator and create a module in the Business Catalog of type LeaveTypes
Create a Business Object of type LeaveObject

Add attributes Requester, from, to and justification
Copy /LeaveApplication/LeaveApplicationProject/businessCatalog/LeaveTypes/LeaveObject.xsd to ../../xsd folder manually

Open the process and in the Structure window create a ProcessDataObject of type LeaveObject. This will be the payload to the process.

Create another data object of type String called outcome. This will capture the response of the Reviewer.

 Open the Organization file and create 2 roles Developer and Manager

Assign achrist to Developer role

Similarly select ‘cdickens’ Manager


Change the Process role to Developer

Add a new swimlane Role ‘Manager’ 


Open properties of the default Initiator User Task. Change it to ‘Request Leave’

Create a Human Task for the Request Leave task. Assign payload ‘LeavePayload’ to the task as parameter and enable editing.


Open the Data Associations and create an association between the LeavePayload and leaveObject of the Task

Create a new UserTask in the Manager swimlane and name it as Review Leave

Create a Human Task ‘ReviewLeave’ and assign the LeavePayload as parameter. Set outcome as Outcome target.

Open Data Associations. They should be automatically be created. Otherwise create them manually


Connect the Request Leave task to Review Leave task


Create an FYI task in the Developer swimlane and name it as Response Leave


Create a Human Task ‘ResponseLeave’ and select the Outcomes as only OK and deselect Approve and Reject

Drag the LeavePayload and outcome to the Parameters of the FYI task


Open Data Associations and make sure the associations are created properly


The process should look like this

Build the Project

To fix the Warnings, Error Assignee has to be set on all the Human Tasks. Follow the below steps.
Repeat the steps for all other human tasks

ReBuild the project


Right click the Application and create a new ADF View Controller Project



Right click LeaveApplicationUI project and select New to create an ‘ADF Task Flow Based on Human Task’


Select Request Leave.task


Wait for the following screen and click OK

Following taskflow will be created.


Rename the page name to RequestLeave and create a jspx page.


Open the Data Controls and drag and drop the Task as shown below on the page to ‘Complete Task with Payload’.

Click OK on Edit Action Binding dialog

Click OK on Edit Action Binding dialog with Task selected

Following page will be created with the payload details
Repeat the above steps to create 2 more pages for ‘ReviewLeave’ and ‘ResponseLeave’ tasks.


Deployment

Right click Process project and Deploy ‘LeaveApplicationProcess’ and follow the below screens



Select the ADF UI project associated with the Process project
Select the Application server




Successful deployment should show something like below.


Testing in BPM Workspace


Login as achrist and click on LeaveApplicationProcess, enter details and click Submit

Logout and login as cdickens and open the task Review Leave 




Click Approve or Reject

Logout and login again as achrist and click on Response Leave task and see the response of the Manager


Oracle Enterprise Manager

The process instances can be monitored in the Oracle Enterprise Manager
Click on LeaveApplicationProcess
Audit Trail shows the tasks completed in that sequence

Flow shows the progress of the process in the form of an image


1 comment:

  1. The "Response Leave" Page at design time showing the OK action button but why after running, the button doesn't appear.

    ReplyDelete