Saturday, September 26, 2009

Human Tasks in Oracle Fusion 11g

With today post I'm closing series of posts, where I was describing how you can orchestrate and connect various services with Oracle Fusion/SOA 11g. Before reading this post, I would recommend to look through my previous related writings:
  1. Web Service Interface for ADF BC Application Module in Oracle Fusion 11g
  2. Service-Enabled Entity Objects in Oracle Fusion 11g
  3. Business Events and ADF Business Components in Oracle Fusion 11g
  4. Business Rules in Oracle Fusion 11g
In those posts I was describing a set of sample applications and modeling SOA solution. This solution is based on three modules:
  1. ADF BC application (A) with custom methods exposed through Web Service
  2. ADF BC application (B) subscribed to application (A) services. Application (B) implements Business Events triggering and ADF Faces Rich Client UI
  3. SOA Composite application (C) to orchestrate business flow based on data from Business Event. Application (C) integrates Business Rule, Human Task and Web Services
Today I will describe Human Task functionality in Oracle Fusion/SOA 11g. Download sample application - SalaryManagement3.zip. This application extends SOA Composite sample developed in my previous posts - ApprovalHumanTaskFlow composite is added:


In BPEL flow, we can see there is a Switch activity added right after Business Rule from previous post:


Switch activity checks Business Rule output and if approval is required Switch scope is executed to trigger Human Task:


Before triggering Human Task, Switch scope invokes EmployeeWorkload method (through Web Service from application (A)), this method provides additional input to Human Task:


Invoke Activity for EmployeeWorkload method:


This method is invoked through Web Service implemented in SalaryControlService (A) application, it is declared in SOA Composite:


Human Task accepts three parameters - Employee Id, Salary Change value and Employee Workload value based on previous assignment history. Manager should approve or reject Salary Change based on provided information:


Human Task wizard in JDeveloper 11g - I have specified Title, Parameters and Approver in Assignment Policy:


There is one more Switch activity and it is designed to route process according output from Human Task. If manager will reject raised request, original salary value will be set back in database. If request will be approved, no action will be taken, because salary value already is updated in database by ADF BC:


Thats it, Human Task is defined and its output is processed. Now its time to check how it works on runtime. Let's use application (B) and for Employee Id = 101 update original Salary value 16000:


To 15000. Salary change is 1000 and this will not violate Business Rule, where it is declared maximum change without manager approval is 5000:


Human Task will not be initiated in this case - process instance will be successfully executed without Human Task intervention:


Let's update now to 23000, it will be 8000 change and Business Rule should trigger Human Task invocation:


You can see Human Task is in running state:


We need to approve or reject raised Human Task in order to complete BPEL process. We can do this through sample Oracle BPM Worklist application provided by Oracle together with Oracle SOA Suite 11g:


When I login into BPM Worklist, I can see there is a Salary Change task assigned to my user:


I can approve or reject it:


In this particular case I have rejected Salary Change and BPEL process became completed:


You can notice in the log, that right after Human Task there was SalaryControlService reference executed, this means Salary Change was rejected and Web Service method was invoked to store original salary value.

7 comments:

HusainD said...

Excellent Series of Posts !

Gasser said...

dear Husain, thanks for your helpful input and for the above article, i followed it and currently i have simple workflow tested and run but through SOA enterprise manager, but i need to invoke workflow process outside the SOA server like BPEL worklist, could you please help me in this issue, if you publish good example like what you did in the above article it will be highly appropriated,
Regards,
Gasser M. Abdullah

Andrej Baranovskij said...

I'm not Husain, I'm Andrejus ;)

Gasser said...

Dear Andrejus, sorry for this mistake, i'm confused
your support and answer for my question will highly appreciated .
regards,

Unknown said...

Dear Andrejus,

I want to assign input variables to task form attributes. For example i have a URL attribute which i have mapped with urlAttribute1 in systemMessageAttributes(this complex element appears in input variable of TaskService). How can i get the urlAttribute value in the taskform.

My requirement is i want to pass values to taskform , concat it and display ...

your help will be highly appreciated

Regards,
Sundar

Unknown said...

Dear Andrejus,

I want to pass values to task form, concat and display the resulting string. I assigned all the input values to taskservice input variables(urlAttribute1,textAttribute1,textAttribute2)
In task form i need to get these three variables, concat and display it. How can I work on this?

your help will be highly appreciated

Regards,
Sundar

Unknown said...

Good series of posts it was nice reading them they were simple and concise.
Keep up the good work :-).