Wednesday, September 30, 2009

Persisting Query Criteria Results Across Sessions with Oracle MDS

For my previous blog post I got interesting comment from one of my readers - Husain. He was asking, how he can save search results across multiple sessions in Oracle ADF application. Actually, while asking he found solution by himself and updated my sample application from my previous post. Today I'll describe this updated application and will cover MDS topic for persisting query criteria results.

Download sample application - As I already have mentioned, this sample is based on my previous sample application from User Customizations for Duration of Session in Oracle ADF 11g blog post. Main update in today sample is changed User Customization level from Duration of Session to Across Sessions with MDS:

When you want to use persistence across sessions feature for saving query criteria results, in order to make it work you need to enable ADF Security in your application:

And define some configuration settings in adf-config.xml file - setup persistence store and define customization class:

That's it, now we can test it. I have defined to users for my sample - john and scott, both have same role assigned and same password - welcome1. First we'll open sample application as john user:

Will perform query and store query parameter together with search results as FirstNameStartsWithS:

Search results are saved, user can navigate away from page and come back, he will have choice to retrieve saved results by selecting previously saved query from Saved Search list:

Now we should do a test - let's close Web browser and open application again. We will check if we will have our saved search remaining in a new session. We should login with the same user as before:

And..., it works - in Saved Search list we can see previously saved query parameter and search results - FirstNameStartsWithS:

If we choose FirstNameStartsWithS saved search, it brings correct results:

Its important to say, persisted changes are saved even WebLogic server goes down, its because user modifications are stored on file system in persistence store directory.

Now we should test with second user - scott, this user should not see saved search results by user john:

It works as expected, there are no saved search results for user scott:

Persistence store is created in WebLogic domain folder structure, you can see separate directories for Model and ViewController:

Difference in View Object for user john, is persisted and we can see saved query parameter with value assigned:

Sunday, September 27, 2009

User Customizations for Duration of Session in Oracle ADF 11g

In Januray, I was blogging about very useful component in ADF Faces Rich Client - Panel Collection. However I got a comment, where user was saying that provided features most likely will not be accepted by the end users (mostly because UI changes were not persisted). That's true, in our project we also were hearing similar complains. Good news today, ADF 11g R1 provides User Customization per Duration of Session, and also its possible to configure persistence Across Sessions using MDS. Today I will quickly show how user changes are stored during active session, without MDS.

Download sample application - In order to implement persistence of user changes during active session, just go to ViewController project properties and in ADF View section set Enable User Customizations For Duration of Session.

Thats it, pretty straightforward. Now how it works - let's open page with Query Criteria and results table:

First column is FirstName, second column is LastName - let's swap those columns and put LastName column as first:

Press Close button to return to Index page:

As it was working before, if user will open same page with Query Criteria and results table, FirstName would be again as first column. But now, since we have enabled User Customizations and it works - as first column will remain LastName:

3G Mobile Internet Usage on Mac OS (Leopard)

This weekend I was using 3G Mobile Internet with my Mac Book Pro, unfortunately network providers usually (with some exceptions) give you client software adopted only for Windows platform. I'm running Windows on Mac OS (Leopard) through VMware Fusion 2.0, however there is a bug in VMware - it can't recognize Mac Book Pro built-in microphone. I can hear, but can't talk - too bad.

But there is quite interesting solution - since I can't configure 3G Mobile Internet device drivers in Mac OS directly, I can access internet connection available in VMware from Mac OS. Thats a bit unusual, in the most of the cases we use Mac OS connection in VMware and not otherwise.

In Mac OS, using AirPort utility, create network:

You create Computer - to - Computer network, set password you want and press Ok:

When Computer - to - Computer network is created, your Mac will not use Wireless connections, it will act as wireless router itself and will utilize available physical networks.

Before starting VMware, make sure you have set Bridged network configuration:

Now its time to start VMware Fusion. When Windows will be up and running, open Network Configuration, you should see there Local Area and your 3G Mobile Internet connections enabled.

If Local Area connection can't get dynamic IP, open network configuration for 3G Mobile Internet connection and set there Internet Connection Sharing option:

Now you should be able to use 3G Mobile Internet directly on your Mac, with VMware Fusion running and acting as internet modem.

Saturday, September 26, 2009

Human Tasks in Oracle Fusion 11g

With today post I'm closing series of posts, where I was describing how you can orchestrate and connect various services with Oracle Fusion/SOA 11g. Before reading this post, I would recommend to look through my previous related writings:
  1. Web Service Interface for ADF BC Application Module in Oracle Fusion 11g
  2. Service-Enabled Entity Objects in Oracle Fusion 11g
  3. Business Events and ADF Business Components in Oracle Fusion 11g
  4. Business Rules in Oracle Fusion 11g
In those posts I was describing a set of sample applications and modeling SOA solution. This solution is based on three modules:
  1. ADF BC application (A) with custom methods exposed through Web Service
  2. ADF BC application (B) subscribed to application (A) services. Application (B) implements Business Events triggering and ADF Faces Rich Client UI
  3. SOA Composite application (C) to orchestrate business flow based on data from Business Event. Application (C) integrates Business Rule, Human Task and Web Services
Today I will describe Human Task functionality in Oracle Fusion/SOA 11g. Download sample application - This application extends SOA Composite sample developed in my previous posts - ApprovalHumanTaskFlow composite is added:

In BPEL flow, we can see there is a Switch activity added right after Business Rule from previous post:

Switch activity checks Business Rule output and if approval is required Switch scope is executed to trigger Human Task:

Before triggering Human Task, Switch scope invokes EmployeeWorkload method (through Web Service from application (A)), this method provides additional input to Human Task:

Invoke Activity for EmployeeWorkload method:

This method is invoked through Web Service implemented in SalaryControlService (A) application, it is declared in SOA Composite:

Human Task accepts three parameters - Employee Id, Salary Change value and Employee Workload value based on previous assignment history. Manager should approve or reject Salary Change based on provided information:

Human Task wizard in JDeveloper 11g - I have specified Title, Parameters and Approver in Assignment Policy:

There is one more Switch activity and it is designed to route process according output from Human Task. If manager will reject raised request, original salary value will be set back in database. If request will be approved, no action will be taken, because salary value already is updated in database by ADF BC:

Thats it, Human Task is defined and its output is processed. Now its time to check how it works on runtime. Let's use application (B) and for Employee Id = 101 update original Salary value 16000:

To 15000. Salary change is 1000 and this will not violate Business Rule, where it is declared maximum change without manager approval is 5000:

Human Task will not be initiated in this case - process instance will be successfully executed without Human Task intervention:

Let's update now to 23000, it will be 8000 change and Business Rule should trigger Human Task invocation:

You can see Human Task is in running state:

We need to approve or reject raised Human Task in order to complete BPEL process. We can do this through sample Oracle BPM Worklist application provided by Oracle together with Oracle SOA Suite 11g:

When I login into BPM Worklist, I can see there is a Salary Change task assigned to my user:

I can approve or reject it:

In this particular case I have rejected Salary Change and BPEL process became completed:

You can notice in the log, that right after Human Task there was SalaryControlService reference executed, this means Salary Change was rejected and Web Service method was invoked to store original salary value.

Monday, September 21, 2009

Oracle JDeveloper/ADF 11g Training in Vilnius

On October 5th, I will run public Oracle JDeveloper/ADF 11g training in my home town - Vilnius. Its always a pleasure to have lectures in native language :) Event is organized by Oracle Lithuania office.

Participants should come with JDeveloper 11g and Oracle XE database installed in their notebooks. It will be master class type event, where I will explain and help to understand tricks of ADF development. Will walk through following topics:
  • Model development with ADF BC
  • ViewController development with ADF Faces Rich Client and ADF Task Flows
  • Custom methods development
  • Performance tuning in ADF applications
  • ADF applications deployment tips
See you there on October 5th:

Place: Reval Hotel Lietuva
Time: 8:30

Hint for Oracle ADF Application Deployment on WebLogic Managed Server (without Oracle Enterprise Manager 11g)

I have described a hint for Oracle ADF application deployment on WebLogic Managed server in my previous post. I was describing how to enable Oracle ADF libraries (JRF files) on Managed Server using Oracle Enterprise Manager 11g Web console.

Those of you, who don't have Oracle Enterprise Manager 11g, there is another way to enable ADF libraries on Managed Server. Just go to Deployments section in WebLogic console:

And for all ADF library related deployments, enable your Managed Server target (by default it is not enabled):

Sunday, September 20, 2009

Manual Oracle ADF Application Deployment on WLS with JDBC DataSource

In Oracle Fusion 11g R1 we can deploy Oracle ADF applications on Oracle WebLogic server directly from JDeveloper 11g - and it works perfectly. However, sometimes we need to deploy EAR file manually from WLS console. If you'll deploy your application to EAR file and later will try to deploy on WebLogic server through console, you will get deployment error related to database connection: No credential mapper entry found for password indirection:

This will happen, when Application Module will be configured to use JDBC DataSource (most common setting while deploying):

I have solved deployment error after reading Steve Muench blog post. He writes there about 'Auto-generate and Synchronize weblogic-jdbc.xml Descriptors During Deployment' checkbox. Its exactly what I was looking for, since I'm doing manual deployment, automatic mechanism for Data Source declaration on WebLogic is not triggered and you're getting errors. So, what you need to do is to uncheck this checkbox:

After this change, application is deployed and works properly (just don't forget to define manually Data Source on WLS):

To illustrate the difference when weblogic-jdbc.xml auto synchronization is on, I have extracted contents for both EAR files:

On the left - when auto synchronization is on, on the right - when it is off. You can see that with auto synchronization option on, one additional file is created - Hr-jdbc.xml. This file contains database connection information and creates problem during manual EAR deployment on WLS. When 'Auto-generate and Synchronize weblogic-jdbc.xml Descriptors During Deployment' checkbox is unchecked, this file is not generated and manual deployment succeeds.

Download manually deployable sample application -

Hint for Oracle ADF Application Deployment on WebLogic Managed Server

In production, usually no one is using WebLogic Admin server for application deployments - thats logical. All enterprise applications should be deployed on WebLogic Managed server. During deployment on Managed Server, I have faced small issue - ADF 11g R1 libraries were not found. However, I have resolved this quite easily, will describe how.

First, let's describe scenario:
  1. I have installed WebLogic Server 11g R1
  2. Configured WebLogic Server Admin domain (develop_domain) and extended it with JRF (Java Required Files - ADF libraries) and Oracle Enterprise Manager 11g
  3. I have created Managed server - dev_server. I will deploy there my ADF application
All the steps seems okej, I can start with ADF application deployment on Managed Server dev_server:

But, during deployment process I'm getting following error - unresolved application library references for

Thats can look strange, because my Admin Server is enabled with ADF libraries, but still Managed Server gives deployment error. Ok, let's Undo changes done during failed deployment:

I have resolved this problem quite easily - just opened Oracle Enterprise Manager 11g console. There you can find a list of develop_domain servers - Admin Server (AdminServer) and Managed Server (dev_server). Open details screen for Managed Server and you will see option to apply - JRF Template for this server. Its exactly what I was looking for:

After JRF Template was applied for Managed Server, Oracle ADF application deployment on this server was successful as well: