Monday, April 29, 2013

Webinar: ADF Master Class and ADF Blog Q&A, Andrejus Baranovskis (Part I)

I was blogging about ADF for 7 years already, long period. I feel this is a right time to bring it to the next level and have live technical ADF Q&A discussion with blog readers. My idea is to organize live ADF call with you - blog readers, we can repeat similar format session later as well - depends how it goes.

Webinar is scheduled for 2 hours at 7 PM (Central Europe time) on May 14th. Number of virtual seats is limited, registration is done on first come first serve basis. Webinar registration link: ADF Master Class and ADF Blog Q&A, Andrejus Baranovskis (Part I), Tue, May 14, 2013 7:00 PM - 9:00 PM CEST.

I will be ready with predefined agenda, but we can go off and speak about any ADF related questions. Predefined agenda for this call:

1. CRUD and LOV performance and validation improvement tricks

2. Conditional validation in ADF BC, Entity Cache and View Object Instances

3. ADF Table pagination, List View components

4. ADF Mobile login, secured ADF BC Web Services and on-device database access


Very excited to speak to you - blog readers, let's meet on May 14th at 7 PM (CET).

Sunday, April 28, 2013

Master-Detail ADF BC Web Service for ADF Mobile

It seems like a bit unclear for the developers if ADF BC Master-Detail relationship can be reused out of the box through ADF BC Web Service in ADF Mobile. Short answer - yes, it can. In order to prove this I have developed sample application - second level Master-Detail relationship is exposed through ADF BC Web Service and consumed from ADF Mobile screens.

Mobile device in the first screen renders list of departments, second screen brings all employees from selected department and finally third screen brings subordinate employees (managed by). Here is ADF Mobile Task Flow implementation:


Here you can download adfmdmobilews.zip sample application, it contains both parts - server side and mobile client.

First screen brings all departments:


Second screen displays list of employees for selected department, first Master-Detail:


Third screen displays list of subordinates, employees managed by selected employee, second Master-Detail:


ADF BC server side is implemented to support classical ADF BC Master-Detail relationship defined with View Links and registered in Application Module:


ADF BC Web Service is exposed with Master VO instance - DepartmentsView1. This instance is enabled with View Criteria (just to bring entire list of departments), empty parameter values for the View Criteria are accepted:


Something very important now. Based on documentation - 11.2.6 How to Support Nested Processing in Service-Enabled Master-Detail View Objects, you must set SERVICE_PROCESS_CHILDREN property on View Link for the Master-Detail relationship be enabled for ADF BC Web Service. I did this for Department-Employees View Link:


As well as for Employee-Subordinates View Link:


This is about the server side, now we switch to ADF Mobile client. You should know that ADF Mobile client Web Service Data Control is stateless (different from regular ADF BC Data Control), this means current row selection is not preserved when moving from one ADF Mobile page to another. For the Master-Detail relationship to work on ADF Mobile client, we must transfer current Master record key between pages, in Page Flow Scope as for example:


We can drag and drop Master-Detail relationship from Data Control as usual in ADF. Here how we can set correct Master key for Detail relationship:


Data Control method - setCurrentRowWithKey is invoked in the second page (detail for Employees based on Department). We are using old good method from ADF 10g times - invokeAction, in order to call executable method on page load:


The same for the third page, where second level detail is implemented for subordinates. Here we call two methods for setCurrentRowWithKey, one for Departments and second for current manager Employee:


Keep in mind that by default setCurrentRowWithKey will not work, because ADF Mobile Web Service Data Control doesn't inherit key setup from ADF BC. You need to set key attribute for each of Data Control bindings manually, from DataControls.dcx go and edit required binding:


JDeveloper generates definition XML file for the binding, you can set proper key. Even it still displays old key and there is no way to remove it, on runtime only proper key is used:


Key is set manually for Employees binding as well:

Tuesday, April 23, 2013

ADF 11g PS6 Table Pagination and Displaying Selected Row Issue

There was a post about new ADF 11g PS6 feature Table Pagination - ADF 11g PS6 - ADF 10g Table Pagination Feature is Back Finally. I had a question from the reader in the comments, about displaying selected row from the page range other than the first. Reader was saying this doesn't work, indeed I tested it with sample application and it doesn't seem to work. If you plan to implement such use case where display of selected row is important, keep in mind there are related issue in ADF UI table pagination. I will describe them below.

Sample application - TablePaginationApp_v4.zip, contains ADF task flow with two fragments. Single row is selected in the first fragment and we try to display the same row in the table from second fragment:


I will show you first how it works by default. Table is set to display 10 rows per page and we navigate to some row in the next page range:


Press Show Employees button to navigate to the table. Table displays first page range, there is no selected row shown:


You can select manually second page range - you will find selected row there:


This is what blog reader explains in his comment - current row is not displayed.

Let's try to apply one trick and see if it works - DisplayRow = selected for ADF table component:


We test now the same thing - navigate to table of Employees with row selected in other than first range page:


Selected row is displayed now, required page range is loaded automatically from the beginning:


But there is another problem now - you are locked in into current page range. Try to press other range page number, it will be changed - but not data, data remains the same and insist to show selected row:


It seems like we can use table pagination only for such use cases, when there is no need to automatically display selected row. At least until workaround is found.

Saturday, April 20, 2013

Oracle BPM 11g Mobile Worklist with ADF Mobile

I have developed ADF Mobile application to bring BPM worklist tasks to the mobile device - I would like to share concepts of such ADF Mobile application with the community. The whole idea is based on BPM Java API to access BPM Context and get currently assigned tasks for the user, read more here - Lightweight ADF Task Flow for BPM Human Tasks Overview. Once tasks from BPM are queried, they are exposed through ADF BC secured Web Service method. Web Service is consumed from ADF Mobile application through Web Service Data Control - task data is rendered on the mobile device, later user can do callback and send approve/reject actions. Approve/Reject actions will be processed by BPM API on ADF BC secured Web Service side.

ADF Mobile login and secured Web Service call implementation is done based on previous blog - ADF Mobile - Secured Web Service Access.

Here you can see BPM mobile worklist solution high level architecture:


Sample application - BPMMobileWorkListApp.zip, is shipped with three separate JDeveloper applications:

1. ADFBasicAuthApp - server side application to allow login into ADF Mobile application running on the mobile device

2. ADFSecuredService - server side application with access to BPM context and exposed secured Web Service providing list of tasks for the current user

3. ADFMobileSecuredApp - ADF Mobile application with connection to secured ADF BC Web Service, displays BPM mobile worklist

User is provided with login screen for BPM mobile worklist application:


Here we can see standard ADF Worklist task flow running in the Web browser with BPM tasks listed. The same tasks are listed in BPM mobile worklist:


In BPM mobile worklist user can select particular task and view details:


1. ADF BC secured Web Service Implementation

ADF BC secured Web Service is implemented and deployed based on this post - Web Service Interface for ADF BC Application Module in Oracle Fusion 11g.

Web Service method returns List type, each task data is represented with one line in the list. Method is exposed through ADF BC Web Service, return type - List:


Connection to BPM context is established with the username retrieved from ADF Security context, password is static for the simplicity of the example:


Sample application contains logic to access BPM context and retrieve all pending tasks for current user. Tasks are collected and returned as List:


Such Web Service can be tested from Oracle Enterprise Manager, using OWSM policy for secured access. See list of task data returned:


2. ADF Mobile application for BPM mobile worklist

Secured Web Service is consumed in ADF Mobile and Data Control is created:


Data is loaded into mobile device screen through proxy Data Control bean - WorkList, in this bean we do parsing of Web Service data retrieved from MobileService Data Control:


Here is the source code for BPM mobile worklist screen - list of tasks:


Screen to display details of BPM task in ADF Mobile:

Sunday, April 14, 2013

BPM 11g R1 Worklist Integration (Hacking Experiment) Into Non-SOA ADF 11g R2 Domain

We all know there are no Oracle SOA/BPM available for ADF 11g R2 platform. In practice it happens to run both environments in parallel - Oracle SOA/BPM 11g R1 for process applications and ADF 11g R2 for ADF applications. Obvious question in such situations - how to access BPM 11g R1 Worklist application from ADF 11g R2 context? Well, this is possible - I will describe in this post how it can be done with some hacks. Keep in mind that officially it is not supported to access BPM 11g R1 Worklist from ADF 11g R2 environment, but if there is such requirement it can be achieved. Previously I was explaining how to run BPM 11g R1 Worklist and Human Task on Non-SOA 11g R1 domain - Running Oracle BPM 11g PS5 Worklist Task Flow and Human Task Form on Non-SOA Domain, today we go one step further and use newer ADF version for Non-SOA domain. But you should know that BPM Worklist is ADF application and really it can run well in ADF 11g R2 context. There are no SOA/BPM libraries for ADF 11g R2 installation, but this is not the issue - we can add and reference SOA/BPM libraries from different 11g R1 domain. There is no need to install complete SOA/BPM 11g R1 domain on that machine where ADF 11g R2 runs - you can copy SOA/BPM libraries package only.

Usually we don't want to deploy and run ADF related applications on the same domain where SOA/BPM is installed. Often ADF and SOA/BPM development is out of synch, this is when we need to make different BPM/SOA and ADF versions talk together.

Here you can download sample application for today post - adf11gr2_bpm.zip. This sample is based on two JDeveloper applications. IntegratedBPMWorklistApp - ADF 11g R2 application with integrated ADF 11g R1 BPM Worklist. EmployeeManagementLab - ADF 11g R1 Human Task ADF UI migrated to ADF 11g R2. BPM process - EmployeeManagement you can download from my previous post - Generic ADF 11g Human Task Handler Concept for Oracle BPM.


Visually this integration between SOA/BPM 11g R1 and ADF 11g R2 looks like this:


BPM process is deployed on SOA/BPM 11g R1 domain. Custom ADF application includes BPM Worklist ADF 11g R1 task flow and runs on ADF 11g R2 domain.

ADF 11g R2 application with integrated BPM Worklist ADF 11g R1 task flow:


Human Task ADF application generated with ADF 11g R1 and migrated to ADF 11g R2 runs on ADF 11g R2 domain:


The same ADF 11g R2 application renders custom ADF screens:


When Human Task is deployed on ADF 11g R2 domain, from the log we can see successful Human Task initialization and registration:


BPM process running on SOA/BPM 11g R1 domain points Human Task URL's to ADF 11g R2 domain:



BPM Worklist task flow is added into ADF 11g R2 custom application and is configured to run in worklist mode. At the end of the day BPM Worklist is ADF 11g R1 application with usage of some additional SOA/BPM libraries - it runs well in ADF 11g R2 context:


Make sure you don't forget to add ADF security permissions for BPM ADF task flows:


Worklist Components tag must be registered - pay attention, it points to the library from SOA/BPM 11g R1 domain.:


There are worklist and task list libraries added into ADF 11g R2 application from SOA/BPM 11g R1 domain:


Shared library - oracle.soa.workflow.wc is installed on ADF 11g R2 domain and must be referenced by custom ADF application with integrated BPM worklist:


You should install on ADF 11g R2 domain 2 worklist related libraries and make sure that WebService Policy Manager library is installed (is needed to communicated to BPM domain securely):


Add Foreign JNDI Provider pointing to the SOA/BPM 11g R1 domain (read more about this from my previous post):


Both applications - custom ADF 11g R2 with BPM Worklist and Human Task are deployed on the same ADF 11g R2 domain:


Ok, we are done with BPM Worklist part.

Let's take a look now into Human Task ADF implementation part ready to run on ADF 11g R2 domain. I simply migrated Human Task application to ADF 11g R2 by opening it in JDeveloper 11g R2:


JSF library is not migrated automatically. You need to remove JSF 1.2 and add JSF 2.0 library manually:


BPM Worklist libraries are added only for compilation, these two libraries are not not deployed:


Configuring ADF 11g R2 environment to run BPM Worklist from 11g R1 is not an easy task, but is doable based on my hacking experiment.