Thursday, November 13, 2014

Dynamic ADF Buttons Solution for Oracle BPM Outcomes

BPM Human Task activity is configured with outcomes. Based on these outcomes, buttons in ADF UI are constructed allowing user to perform different actions with the task. Auto generated ADF Human Task form contains a set of predefined buttons and this set is controller with rendered flag. My sample application is using different approach, it implements custom tasks table and dynamic ADF UI for the human task input form - Dynamic ADF Form Solution for Oracle BPM Process. Once user selects a task, action buttons are generated dynamically - using a set of outcomes configured for the particular task.

Here you can download complete sample application - This application implements a method based on BPM API, where a list of outcomes by the currently selected Task ID is fetched from BPM engine:

Each outcome is represented by ActionType. I'm constructing a list of outcomes to be used on ADF UI. There is ADF UI iterator components on the fragment, this component is generating dynamic buttons, based on the constructed set of outcomes. Outcome name is used to set button name and outcome itself is used as attribute value for the generic action listener method:

Generic action listener method is responsible to parse outcome name, initialise a payload if needed, and execute BPM API to submit the outcome for further task processing:

We can check how this works. There is a human task AssignEmployee with SUBMIT outcome, in the sample application:

Task action button is generated accordingly - there is only one Submit action button for the selected task:

The next human task ApproveEmployee is set with two outcomes - APPROVE and REJECT:

Based on the set of the outcomes, two buttons are present now - Approve and Reject:


Onkar Shoker said...

Amazing, thanks.

Huy do quang said...

Hello Can you reupload your example ?

Andrejus Baranovskis said...

You should be able to download it.


Huy do quang said...

Thanks you Andrejus!