Wednesday, June 5, 2013

One more step in ADF/BPM integration I would like to cover today. This is based on BPM 11g PS6 ADF sample application with included BPM workspace ADF task flow - Customized BPM 11g PS6 Workspace Application. I will show in this post how you can start new process instance from ADF with BPM API.

Sample application - adfbpmapp_ps6_v1.zip implements custom ADF Task Flow with ADF UI Fragment, where regular ADF UI table component is implemented to display current user tasks. Additionally there is a button "Start New Task" to start new process and assign further tasks:

Once "Start New Task" button is pressed, it calls action listener from the backing bean, where BPM functionality is invoked. If task was started successfully and task ID was generated, we are going to report it to the user:

Task is started by getting tasks possible to initialize from BPM context connection for current active user. Process instance is created for such task and task ID is retrieved. In this example I'm getting first available initiable task. BPM API returns initiable task even if user is not granted permission to start it through BPM role, is enough for the user to be part of the process. For this reason there is additional check if user has appropriate BPM swim lane role:

In this example must be granted GroupManagers swim lane role to be able to start new task and call task initializer activity:

User redsam1 is able to start new task through BPM API, information about just started task ID is displayed along with task info in the table:

The same task info is displayed in BPM workspace task flow, where task form can be accessed:

User redsam2 is not granted with GroupManagers swim lane role, and this user can't start new tasks as reported:

Hi Andrejus.Thanks for response.You see, I already have some pages and regions with bindings to the payload. Inside of BPM worklist they work fine, but now I want reuse them in a custom application. So, I have to pass somehow bpm parameters (context, taskId and so on) and invoke the bounded taskflows from my custom ADF application. Have you had anything similar situation?