Sunday, July 22, 2012

Lightweight ADF Task Flow for BPM Human Tasks Overview

We can customize and include available Oracle BPM Workspace task flows into our own ADF 11g application. Additionally to out-of-the-box task flows in Oracle BPM 11g, we can use Oracle BPM 11g Worklist API and build custom ADF task flows. While there can be different requirements and scenarios, in typical case I would suggest to use customized out of the box Oracle BPM 11g provided task flows for core requirements and additionally implement your own custom task flows based on available Worklist API. Most likely custom task flows based on Worklist API would cover less functional, but more lightweight requirements.

I have implemented such sample lightweight task flow - it shows a list with assigned tasks. Download sample application - Here is how this task flow looks - simple table with assigned tasks:

Same application includes BPM Workspace task flow with complete functionality for Human tasks:

In order to implement your own ADF task flow with access to BPM context, you should follow instructions from Oracle documentation - 33 Building a Custom Worklist Client. I'm using sample application from previous post - Tips & Tricks How to Run Oracle BPM 11g PS5 Workspace from Custom ADF 11g Application. This application is extended with additional libraries required to access BPM API:

You can access BPM functionality through BPM context. It takes time to initialize BPM context, its why Oracle says to create it ones and keep in session scope. Ideal place to create BPM context is Login method. Check - initBPMContext(username, password) method, it authenticated to BPM environment and when context is created - stores it into session scope:

ADF task flow contains one fragment with read-only table to list assigned tasks:

Table is created from data control generated on top of Java class, where we are accessing BPM context and retrieving assigned tasks:

Data control class is responsible to construct a list of tasks, with task state - assigned. I'm reusing BPM context from session scope:

Tasks query is created, iterating over results and populating list of tasks:

Task list construction method is executed automatically, when table is rendered on the UI. For refresh functionality to work, we need to re-execute retrieveAssignedUserTasks() method and refresh iterator. Here is page definition for the fragment:

Refresh invokes task list construction and at the end calls iterator refresh:


Cristián Sánchez said...

How to test this application ?, where i deploy it ? soa_server ? the URL let this message when i try to invoke the application.

Error de OracleJSP:
Defina el parámetro de inicialización debug_mode en "true" para consultar el mensaje de excepción comple


Andrejus Baranovskis said...

Easiest way is to deploy to SIA server. Access using application context root, you can check it from deployment profile or application description in EM. Add faces/main after context root.


Cristián Sánchez said...

Thank's it works fine.

Now i have this question.

How i configure the Hr Datasource ?.

Sorry for my english and for the questions, but i'm not expert on this.

Regards from Chile.

Sameer said...

Hi Andrejus

I am a bit stuck at getBPMContext() method.
It works with the querySvc.authenticate() API when we give username and password.
But our application will be a single sign on, integrated with AD and we will not be even having a login page for the application.
The application uses the windows logged in user authentication
In such case, can you please tell how to get the IWorkflowContext object ?