Tuesday, September 27, 2016

BPM Worklist API 12.2.1.1 and Custom ADF 12.2.1.1 Application

I have updated my sample app with BPM API usage in ADF application to 12.2.1.1. Originally this was developed with ADF/BPM 11.1.1.7 - 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 12.2.1.1 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:

8 comments:

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

Andrej Baranovskij 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.

Andrejus

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?

Andrej Baranovskij 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.

Andrejus

Debajyoti Basu said...

Dear Andrejus,

When i try creating a task using weblogic user it displays :-There are no tasks to start !. Am i missing something ,can you kindly help ?

Regards,
Dev.

Daniel Merchán García said...

Hi Andrejus,

Just to inform you in 12.2.1.2 and 12.1.2.3 versions the dependencies of libraries has been changed a little bit for making your Worklist working.
I will post a blog about how to fix this soon :).

Kind regards.

Andrej Baranovskij said...

Thanks for update :)

Andrejus

Ahmed Mamdouh said...

Very helpful topic, Thank you Andrejus

Your sample works fine for me in 12.2.1.3.0 but I faced "weblogic.application.ModuleException: java.lang.ClassNotFoundException: oracle.rules.sdk2.dictionary.RuleDictionary"

So I did small change in attached library, Actually I used 'BPM Client' library instead of.

which contains:
bpm-services.jar
oracle.bpm.bpm-services.client.jar
oracle.bpm.bpm-services.interface.jar
oracle.bpm.casemgmt.interface.jar
oracle.bpm.core.jar
oracle.bpm.project.model.jar
oracle.bpm.project.ui.jar
bpm-infra.jar