Tuesday, September 27, 2016

BPM Worklist API and Custom ADF Application

I have updated my sample app with BPM API usage in ADF application to Originally this was developed with ADF/BPM - Dynamic ADF Buttons Solution for Oracle BPM Outcomes. There are several changes in BPM libraries usage. I will describe it all step by step.

Download sample application - adfbpm12211.zip. This archive contains both BPM and ADF app. BPM process implements two roles - request holiday and approve holiday:

Main goal of such use case - we don't want to use out of the box Oracle Worklist app, but prefer to develop our own business logic and manage BPM process from custom ADF app through BPM API. It is important to initialize Workflow context one time during login, this can be heavy operation and we should not call it each time when BPM API is invoked:

I'm using authenticateOnBehalfOf method. This allows to use admin user as a proxy for business user connection. Once Workflow context is established, we can get BPM context to use it for BPM API calls, all this is done during login into ADF app:

Assigned tasks are fetched through Workflow context:

We can initiate new task through BPM API in our custom ADF app:

There is a way to generate buttons to control task actions dynamically. Buttons can be generated on top of task outcomes list obtained from BPM API:

Task action can be executed with payload info, this allows to pass correct info to the next step in the process:

Let's see how it works. User can start new BPM task from ADF:

When task is submitted to approval, manager is assigned task to approve or reject holiday request. Buttons are generated dynamically based on task outcomes:

To double check executed flow from BPM API in ADF we can review it in EM control:

ADF application must import BPM API JARs to be able to compile Java code. In ADF it is enough to import BPM Services JARs:

There is no need to package these JARs into application archive, these should be referenced for compile time only:


Anonymous said...

Usefull Article.
I have a similar usecase, in my case I have to show the task UI after selection.
I'd like to use the task UI page that i can generate with task paylod. How can I do? Using the old 11g I have use the worklist taskflow

Andrejus Baranovskis said...

You could reference Human Task UI through inline frame, same as standard Worklist does. But I would build custom UI, not dependent on Human Task generated form.


Anonymous said...

Andrejus, In you custom ADF UI is there any reason why you are not using Oracle BPM 12C REST API's instead of EJB remote?

Andrejus Baranovskis said...

This sample was migrated from 11g, there was no REST API at that time. For new apps I would use REST API. Actually there is a blog coming soon about BPM REST API.