Showing posts with label Workspace. Show all posts
Showing posts with label Workspace. Show all posts

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 - IntegratedBPMWorklistApp_v4.zip. 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:


Saturday, July 14, 2012

Tips & Tricks How to Run Oracle BPM 11g PS5 Workspace from Custom ADF 11g Application

Oracle BPM 11g PS5 Task List task flow can be included into custom ADF 11g application. This task flow can be executed in 2 modes - worklist and workspace. I already blogged about worklist mode, see here - ADF 11g PS5 Application with Customized BPM Worklist Task Flow (MDS Seeded Customization). Today I'm going to cover different tips & tricks how to run Task List task flow in workspace mode. Workspace mode gives more functionality to the end user - it allows to render list of BPM processes, more dashboards, etc. User can start new BPM process through Task List task flow configured in workspace mode.

Download sample application configured with BPM 11g PS5 Task List task flow for workspace mode - IntegratedBPMWorklistApp_v3.zip. This application is based on the same sample from previous blog for worklist mentioned above.

Sample application is extended with additional custom ADF task flow, bringing data for employee record - this is to demonstrate, Oracle BPM 11g PS5 Task List task flow really can run together with other custom ADF task flows present in the same application. Employee data region is rendered from separate tab:


BPM Workspace tab brings BPM workspace region. User can access assigned tasks, initiate new BPM process from available applications, complete Human Task details, etc.:


Custom ADF application, includes Task List task flow in workspace mode, see task flow parameter value:


There is no very clear documentation about how to run Task List task flow in workspace mode and what libraries are required to be added to your custom ADF application. But we always can check how standard BPM application from Oracle is configured. Go to SOA home, navigate to soa/applications folder - open OracleBPMWorkspace.ear and check contents of this deployment archive. File - weblogic-application.xml includes references to the libraries deployed on the server, make sure to copy same library references into weblogic-application.xml from your custom application (if you deploy custom application on non-SOA domain, make sure to have these libraries deployed):


Library references found in weblogic-application.xml file:


Additionally to referenced libraries, some of the libraries must be packaged together with application. You can check this in the same OracleBPMWorkspace.ear file, WEB-INF/libs folder. Seven additional libraries are included directly into application:


You should notice that two last libraries are coming from JDEV home. These libraries provide us with BPM Task List task flow. Same libraries are available in SOA home as well - strange enough when using libraries from SOA home for BPM Task List task flow - my custom application was not working. Keep in mind this, if you face strange runtime exceptions, to check what libraries you are including.

Even with all libraries included, on runtime exception happens when accessing BPM Task List task flow in workspace mode. It fails to initialize ADF region for External Links task flow:


To workaround this problem, I decided to disable External Links task flow from Oracle BPM Task List library. In order to disable it, I restarted JDev in Customization Mode and opened main view for workspace - bpmHome.jsff:


I noticed that External Links task flow is registered in the left panel accordion. Panel accordion is implemented as declarative component by Oracle, is referenced directly from bpmViewList.jsff:


Open bpmViewList.jsff, now we can manipulate with panel accordion content and disable External Links section:


Select External Links af:showDetailItem element and go to Properties, select Rendered property:


Set Rendered property to be false - this means External Links section will remain hidden:


JDev creates MDS customization file and includes metadata info to hide External Links section from standard Oracle BPM library - this allows us to load Task List task flow in workspace mode successfully: