Thursday, January 5, 2012

ADF Data Control Fix for BPM 11g Human Tasks

There is one thing worth to know about auto-generated ADF Data Control from BPM 11g Human Task. JDeveloper assigns same root package names for different BPM 11g Human Task projects, this hides ADF Data Control entry from Data Control window and prevents ADF developer from using it. Reproduced with JDeveloper 11g PS4. Workaround - manually refactor DataControls.dcx file into unique root folder.

Typically developer auto-generates or creates ADF Data Control for BPM 11g Human Task using JDeveloper wizard options. Let's generate ADF Data Control for ResourceRequest Human Task:


Generate another ADF Data Control for ResourceApproval Human Task:


As result, we have two projects auto-generated with ADF Data Control for both Human Tasks. While generating these projects, there was no option to specify preferred root package - it generates same com.redsamurai for both projects:


Open Data Controls section, you will see only one ADF Data Control available. But we should have two, one for each Human Task:


Refactor root package to be unique and DataControls.dcx file not to be on the same package path in different projects, for example append com.redsamurai.request name:


Now both ADF Data Controls show up correctly:


For your reference, download sample application - ResourceAllocationProcessApp.zip.

Thursday, December 29, 2011

Groovy with View Link Accessor

My last post this year, I'm closing 2011 with #106 posts and will resume early 2012 (already next week).

This post is based on question logged on our public Wiki (Red Samurai Ora-Bug Tracker) - reference attributes in other view objects using groovy. Developer was asking how to access attributes from different View Objects using Groovy. Answer - attributes can be referenced using Groovy by View Link Accessor name, similar as we can reference in Entity Object by Association name. Pros and cons are discussed as well, and why I prefer standard View Object join.

Download sample application - ViewLinkGroovyApp.zip. In order to reference another View Object attribute through View Link Accessor, first we need to check if View Link Accessor is exposed in View Object. In this example I would like to reference City attribute from Locations, in Departments View Object. As we can see, View Link Accessor is not exposed yet in Departments:


Let's edit accessors and select to be exposed in Departments, as LocationsView name:


View Link Accessor is exposed in Departments and can be referenced through Groovy:


Add new transient attribute in Departments View Object - LocationCity:


Set default value as Expression and type such Groovy statement - LocationsView.City:


This will access referenced View Object (Locations) on runtime. You should be aware, ADF will execute two SQL statements to render Departments data (instead of one by default). Second executed statement will be generated to populate Groovy script expression:


I would recommend better to use standard View Object join, based on Association - it will retrieve same value directly using SQL join, without forcing to execute second SQL statement from Groovy.

Open Entity Objects section and define SQL join based on Entity Object association:


Add new attribute from joined Entity - City attribute:


Referenced attribute will retrieved through SQL join:


I wish you great start in 2012 !

Wednesday, December 28, 2011

ADF Train - Apply Custom Train Stop Icons

This post is based on ADF Code Corner article from Frank Nimphius - 93. Put a different Look to your Train Stop. Frank describes how we can control and customize ADF Train rendering. Recently I had similar requirement, additionally it was required to change standard ADF Train Stop icons with custom ones. In order to implement this requirement, I was following steps from ADF Code Corner sample #93, plus few minor additions.

I didn't wanted to use ADF Skin to customize ADF Train look and feel, but control rendered icons directly. Download sample application with applied custom icons for each stop - ADFTrainApp.zip.

Sample ADF Train contains three stops:


ADF Train UI component is implemented inside ADF Fragment UI template - no need to duplicate ADF Train UI inside each fragment. Comparing to ADF Code Corner sample #93, one more property is declared - icon. This property points to managed bean method, where based on currently rendered train stop we return icon to be assigned for current stop:


Method retrieves activity ID for currently rendered ADF Train Stop and returns associated icon:


Here is how our customized ADF Train looks - first stop is for General:


Second stop is for Details:


Third stop is for Payment:


Saturday, December 24, 2011

SOA & WebCenter & BPM & WebLogic Partner Communities Event Invitation

INVITATION TO

FUSION MIDDLEWARE PARTNER COMMUNITY FORUM 
SOA & WebCenter & BPM & WebLogic Partner Communities

Do you want to learn about how to sell the value of Fusion Middleware by combining SOA, BPM and WebCenter Solutions?

We would like to invite you to become updated and trained at our Fusion Middleware Partner Community Forum on February 7th and 8th 2011 at the NH Hotel in Malaga, Spain.


The event is a wonderful opportunity to:
  • learn how to sell the value of Fusion Middleware by combining SOA and WebCenter solutions
  • meet with Oracle SOA, BPM and WebCenter Product management
  • exchange knowledge and have access to competitive intelligence
  • learn from successful SOA, BPM, WebCenter and ADF implementations
  • learn about WebCenter Sites
  • network within the Oracle SOA Partner Community and the Oracle WebCenter Partner Community
During this highly informative event you can learn about partner success stories, participate in an array of break out sessions and exchange information with other partners.



Red Samurai will be doing ADF/WebCenter Master Class session together with colleagues from InfoMentum and VASSIT.

Wednesday, December 21, 2011

How to set EAR Version for ADF Application on WebLogic

If it happened to deploy ADF application on WebLogic, most likely you noticed that it assigns default version V2.0 for each ADF deployment. We would like to set our own specific version, instead of having V2.0 assigned by default:


This can be achieved by creating Manifest file inside root src/META-INF folder:


You must create Manifest file by yourself and it should be visible under META-INF descriptors from JDeveloper:


ADF application version is specified by Weblogic-Application-Version parameter inside Manifest file:


Register Manifest file with application deployment profile - include Manifest under EAR options:


Make sure to remove Manifest file from Application Descriptor filters - otherwise file will be included twice and deployment fail:


Application with our predefined version is deployed. Previos version is not removed, but is retired - we can remove it later or restore if needed:


Download sample application, it includes sample Manifest file - ADFVersionApp.zip.

Thursday, December 15, 2011

ADF Tree - How to Autoselect/Deselect Checkbox

If you want to add selection checkbox to ADF tree, read this post - ADF Tree - How to Add Checkbox. Today I will describe how to implement auto-selection for the same checkbox. Checkbox selection will be calculated using Groovy, based on additional helper attribute.

Download updated sample application - TreeCheckboxApp_v2.zip. This sample is extended with additional helper attribute on EO level, for Regions and Countries EOs. This is transient String type attribute - RegionConfirmedStatus for Regions EO:


RegionConfirmed boolean attribute value is calculated trough Groovy, based on RegionConfirmedStatus character value - Y = true, else = false. This is required, otherwise boolean value is not changed directly. It works well, when value is calculated from Groovy:


Same for Countries EO - CountryConfirmed attribute:


On UI, ADF UI component - selectBooleanCheckbox, should be configured with value change listener and enabled with auto submit - this allows to catch checkbox change event:


Value change listener is not changing boolean value directly, but is changing only helper attribute value (Y/N). When change is performed, Groovy is fired on EO level and recalculates main boolean attribute value used for checkbox. If we would change boolean value directly, this value is not preserved and is reset back to original value during next refresh. Helper attribute value is changed for Regions level as well as for Countries level (iterating over detail collection):


Implemented functionality - user selects top level node - dependent child nodes are auto-selected (and opposite on deselect):


Monday, December 12, 2011

ADF Tree - How to Add Checkbox

This is common request - to add checkbox next to ADF tree nodes. Obviously we should use ADF selectBooleanCheckbox component - however selectBooleanCheckbox is not propagated across ADF tree levels by default (applies to all ADF 11g versions). This post provides sample application for selectBooleanCheckbox rendering on different ADF tree node levels.

Download sample - TreeCheckBoxApp.zip (tested with ADF 11g R1 PS3/PS4).

Implemented tree renders two levels (Regions -> Countries):


Both level nodes are rendered with checkboxes. Checkbox is rendered based on transient EO attribute, Boolean type for Regions:


Same type attribute for Countries:


ADF tree binding contains both - Regions node name and checkbox definitions:


Similar binding for Countries:


ADF UI implements tree table (with selectBooleanCheckbox), first tree level is rendered from nodeStamp. As you can see both levels are getting values from node variable:


Let's run such tree - disabled checkboxes are rendered for empty level nodes - this is wrong:


How we can fix this? Add rendered expression for both selectBooleanCheckbox components. First level checkbox should be rendered only when RegionName is not Null:


Second level accordingly, when CountryName is not Null:


Now checkboxes are rendered correctly with ADF tree: