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:


Monday, July 9, 2012

Running Oracle BPM 11g PS5 Worklist Task Flow and Human Task Form on Non-SOA Domain

With standard setup, both BPM worklist application and Human task form runs on the same SOA domain, where BPM process is running. While this work fine, this is not what we want in development, test and production environment. Mainly because BPM worklist and Human task form are ADF artificats, its easier to develop and run in production from different server. I will describe in this post how to run both BPM worklist application and Human task form on different non-SOA domain. There are two main advantages for such architecture:

1. BPM Worklist TF will be integrated into custom ADF application, no need to run standard BPM Worklist application from SOA domain (read more from previous post - ADF 11g PS5 Application with Customized BPM Worklist Task Flow (MDS Seeded Customization))

2. Human Task form will run on the same non-SOA server, where custom application is deployed (it integrates BPM Worklist TF)


All this makes ADF part less dependent on SOA specifics, as well allows to minimize workload on SOA domain.

Main goal of this post is to aggregate all available information from Oracle documentation into one single sample application. There are several things not working as described in the documentation, I will point below. In order to prepare sample applications for BPM worklist TF and Human task form to be deployed on non-SOA domain, I was using following chapters from Oracle SOA/BPM 11g PS5 developer guides:

1. A Creating Custom ADF Applications with Oracle Business Process Management Workspace Task Flows

2. 30.8.4 How To Deploy a Task Form to a non-SOA Oracle WebLogic Server

Download sample applications:

1. Sample BPM process and Human Task Form - Lab02_v2.zip

2. Custom ADF application with integrated BPM worklist TF - IntegratedBPMWorklistApp_v2.zip

Both applications are deployed on the same non-SOA domain (except for BPM process), I'm using JDev Integrated WLS server 7101 port for this - CreateOrderTaskForm (Human task form) and IntegratedBPMWorklistApp (BPM Worklist TF):


I was deploying CreateOrderTaskForm application first. Follow this section from Oracle SOA/BPM developer guide: 30.8.4 How To Deploy a Task Form to a non-SOA Oracle WebLogic Server. While provided documentation info is very useful, still you can't follow it completely.

Decide first, how you would like to run BPM Worklist TF. There are two options - federated and normal modes. Federated mode provides less functionality, is designed for remote servers. My sample app is configured (as by default) to run in normal mode, this means there is no need to create wf_client_config.xml file.

Create Foreign JNDI with links pointing to SOA server - this will allow to connect from non-SOA domain to SOA server:


Links:



Assign BPM security grants in system-jazn-data.xml from non-SOA domain. You still will see security error, when starting non-SOA domain, it will try to register Human task form with BPM process and will fail - you can ignore this.

One thing you should point your attention is oracle.soa.workflow library installation on non-SOA domain. If non-SOA domain already have WebCenter extensions installed, most likely there already exists another library - oracle.soa.workflow.wc. Developer guide says you can use either one or another. What I experienced - when I had both libraries installed, I was getting class path conflicts when starting BPM Worklist TF. If you will get similar error, double check may be both libraries are installed. I have only one:


Once configuration is completed - you can deploy Human task form. Deployment is done on JDev integrated server:


BPM process is deployed on SOA enabled domain:


Define Human task form URI for BPM process. Go to BPM process in Enterprise Manager and select Human Workflow component:


Specify address for Human task form associated with selected BPM process (server port should point to non-SOA domain in this case):


First part is completed - now we move to BPM Worklist TF (IntegratedBPMWorklistApp_v2 application). We are not using out of the box shell application - BPM Worklist. Instead we are using only Task List TF from that application, inside our own custom environment. Read more from Oracle BPM developer guide - A Creating Custom ADF Applications with Oracle Business Process Management Workspace Task Flows.

There is one thing that developer guide doesn't say. If you will configure BPM libraries for your project as developer guide says - you will get errors when running application directly from JDeveloper (libraries are not copied into deployment folder). It works well, if you will deploy on the server, but not when you run from JDeveloper. This happens, because standard BPM Worklist Components library available in JDeveloper is not marked to be deployed (and this option is disabled to change):


Same for BPM Services library, this library is mandatory on class path when deploying on non-SOA domain:


Libraries are not copied into deployment folder when running from JDeveloper, even there is a check:


Workaround it to create your own library group (for example - Custom BPM Worklist), add all 3 required libraries and set to be deployed by default (important if you want to run BPM Worklist TF application from JDeveloper directly):


Custom library is added to the project:


JAR files included through the custom library are targeted for deployment:


BPM Worklist TF - TaskList is included using Worklist mode (Workspace also possible, but will require additional libraries to be added):


Make sure security is granted to each resource:


Deploy custom ADF application with BPM Worklist TF to integrated WLS server:


BPM Worklist TF and Human task form is running from custom ADF application, deployed on JDeveloper integrated WLS server port 7101:


To summarize content of this post:

1. Enable JDev integrated WLS domain to run SOA

- Install Oracle SOA Workflow library, if required. Configure foreign JNDI. Set security grants for BPM

- Deploy

- Change Human task form URI

- Test from BPM Worklist application

2. Run BPM Worklist TF on non-SOA JDev integrated WLS domain

- Set domain trust password

- Define custom library for BPM components

- Make sure no conflicts between oracle.soa.workflow and oracle.soa.workflow.wc

Tuesday, July 3, 2012

Running ADF BC Browser inside Oracle BPM 11g Applications

Did you had a chance to developed Oracle BPM 11g application in combination with ADF BC? If yes - most likely you faced a problem with ADF BC Browser. ADF BC test utility simply doesn't start, if ADF BC project is implemented in the same application, where BPM process is defined. Most common error: MDS-01330: unable to load MDS configuration document. Don't worry - there is workaround for this bug.

Once again - ADF BC project is implemented within the same application, where we have BPM process project. Try to run AM:


Error is thrown about JBO-33001: Configuration file /tester.xcfg is not found in the classpath:


Workaround is to temporary (until you want to run ADF BC Browser) comment out MDS definition in adf-config.xml file:


ADF BC Browser is starting successfully now:


Looks like there is a conflict between ADF BC Browser runtime and MDS store configuration in adf-config.xml, specifically for BPM 11g applications. There is no such problem when running ADF BC Browser in WebCenter 11g applications. Make sure to uncomment MDS definition, when ADF BC Browser is not needed anymore.

Friday, June 29, 2012

Immediate Effect for ADF Table Content Delivery

During stress load, we noticed complex ADF pages on load may produce more than one ADF passivation/activation events. This may decrease performance, because passivation/activation involves additional database calls plus ADF framework rendering functionality gets slower. We managed to debug one of such complex pages - this page was rendering many small tables in the same single page. During page load, it stress load environment, it was producing multiple activation/passivation events.

The trick was in Content Delivery setting for ADF Table component. By default this setting is set with whenAvailable value. While it works correctly, in some cases it may bring side effects for performance.  If you notice slow performance for ADF table rendering - double check Content Delivery property for ADF table. We would recommend to set it to immediate.

This is not only ADF table performance rendering, there might be additional huge side effect for system performance based on ADF table configuration. Imagine - ADF table rendering is triggering multiple activation/passivation events. In turn this triggers multiple prepareSession() method invocations. Very often we call DB PL/SQL initialization logic from prepareSession() method. If invoked PL/SQL logic is complex, it will be invoked multiple times with table rendering and this will make your system slow.

Download sample application - MultiTaskFlowApp_v2.zip.

Sample application is set with disabled AM pooling, to spot how it will be have in stress load environment:


prepareSession() is overriden in AM implementation class to track how many times AM is initialized (during activation/passivation events):


Sample application contain standard JSF page with out-of-the box readonly table component (all property settings are default):


Run sample application, it will load and invoke prepareSession() two times:


Set table ContentDelivery to Immediate - it will invoke prepareSession() only once on stress load and complete only one activation/passivation event:


Wednesday, June 27, 2012

ADF 11g PS5 Application with Customized BPM Worklist Task Flow (MDS Seeded Customization)

What is great about Oracle BPM - it offers reusable ADF Task Flows to handle BPM Worklist functionality. BPM ADF Task Flows are consumed from standard BPM Worklist application, from WebCenter and same ADF Task Flows can be consumed from custom ADF application (so, you don't need to run WebCenter for this). Here is documentation chapter, it explains all step by step how to integrated BPM ADF Task Flows into custom ADF application - Creating Custom ADF Applications with Oracle Business Process Management Workspace Task Flows.

In this article I'm going one step further and investigating how you can customize standard BPM Task Flow through MDS Seeded customization. This means you will be able to adapt standard BPM Task Flow to your specific requirements. If requirements are very custom - there is a way to access BPM Human Task functionality through Java API (topic for future posts). Additionally to BPM Worklist, I have tested access to all ADF Task Flows related to BPM from WebCenter Spaces - it all works inside custom ADF application as well (requires some customizations as well, topic for future posts).

Download basic ADF 11g PS5 application with customized BPM Task Flow - IntegratedBPMWorklistApp.zip. This application imports Worklist Task Flow, also there is custom button included - Register (suppose it takes selected task ID and calls custom ADF BC method to register task info in database):


This button - Register, is not available with standard BPM Worklist Task Flow - it was added by me, through MDS Seeded Customization applied for ADF application. Task is registered:


Firstly, let me refresh your knowledge a bit and walk trough most important steps described in documentation for including BPM Task Flows into custom ADF application.

BPM Task Flows are imported through added library - BPM Worklist Components:


Must register oracle.soa.workflow library inside weblogic-application.xml:


Include BPM Worklist ADF Task Flow, set taskFlowMode=worklist (if you set workspace, it will render same BPM Worklist task flow as in WebCenter Spaces, plus additional configurations), showViewsPanel=true (accordion on the left) and showTaskDetailsPanel=true (inline window for task details):


Thats all about including BPM Worklist into custom ADF application. Now will talk about how to customize it.

Sample application implements ADF BC and one custom method in AM Impl class - registerTaskWithDb(taskId):


This is dummy method, in real life you would call ADF BC logic from here. Method is exposed through Client Interface - means accessible in Data Control:


There is backing bean declared, it calls custom method from AM Impl. Action Listener from this bean will be invoked from standard BPM Worklist ADF Task Flow through MDS Seeded Customization:


Will cover every MDS Seeded Customization defined in sample application. BPM Worklist page contains page definition, I have customized it to include AM Impl custom method reference (because this method will be called from BPM Worklist context):


Data Bindings file is customized to include reference to HR AM from our custom application:


Task List toolbar is updated to include our custom button - Register. You should notice Action Listener points to Helper Bean:


Helper Bean is registered inside BPM Worklist Task Flow as well - this definition is stored inside MDS Seeded Customization:


MDS Seeded Customization is enabled from ADF View section on ViewController project:


ADF SiteCC customization class must be set in adf-config.xml, otherwise Site customization will not be applied:


Restart JDeveloper in Customization Developer mode:


Here how it looks BPM Worklist ADF Task Flow in customization mode:


Thursday, June 21, 2012

Radio Group List Support by ADF BC

Radio Group List is frequently used in Oracle Forms application screens. Same construct is supported out of the box in ADF BC. ADF BC together with ADF Faces UI perhaps is one of the best frameworks to modernize legacy enterprise applications and enable them for the Web. I will show you today how easy it is to enable Radio Group List in ADF 11g.

Sample application - RadioTableApp.zip, implements static VO with 3 values for Low, Average and High (L, A and H):


Main VO - JobsView, contains one transient field - Status. I'm using this transient field for demo purposes to assign Radio Group List. Transient field value is calculated using Groovy expression, it returns (L, A or H):


LOV is defined for Status field, it maps with static VO and returns Id into Status:


We want to display this LOV as Radio Group List - just set list type to be Radio Group, framework will take care for the rest:


Radio Group List is rendered for every row inside ADF table:


Sample applications doesn't process displayed Radio Group List changes, but you can do it easily based on specific use case requirements.