Tuesday, 28 November 2006

Raise a Business Event from your OAF Page

After quite a while of inactivity, due partly to a frantic schedule and the addition of a new obsession in the form of my new mountain bike, I am back on the horse and very excited to start blogging again. A Big thanks to Steven Chan for profiling the Oracle EBD Developer on his blog, just the kick I needed to get going again.

I recently had the opportunity to present the 11i/2.6 Implement Oracle Workflow course at Oracle South Africa, which turned me onto business events in a big way. Now I have previously blogged about launching an Oracle Workflow process from an OAF page using the oracle.apps.fnd.framework.webui.OANavigation class. In this post I would like to demonstrate how we can raise a business event through the Oracle Business Event System (OBES), which enables you to utilize the extensive functionality of the OBES to launch workflow processes and perform a number of diverse actions.

import oracle.apps.fnd.wf.bes.BusinessEvent;
import oracle.apps.fnd.wf.bes.BusinessEventException;
....
...
..
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);

if (pageContext.getParameter("Submit") != null)
{
// Get Transaction
OAApplicationModule am = pageContext.getApplicationModule(webBean);
OADBTransactionImpl oadbTrx = (OADBTransactionImpl) am.getOADBTransaction();

// Create BE Object
String eventName = "companyabc.oracle.apps.xx.event.createrequest";
String eventKey = "1001-1";

BusinessEvent busEvent = new BusinessEvent(eventName, eventKey);

try
{
// Set Event Property
busEvent.setStringProperty("XX_TRX_TYPE", "NEW_REQUEST");

// Raise Event
busEvent.raise(oadbTrx.getAppsContext().getJDBCConnection());
}
catch (BusinessEventException exception)
{
// Set Message Tokens
MessageToken[] tokens =
{ new MessageToken("EVENT_EXCEPTION",
exception.toString())
};

OAException eventErrorMessage = new OAException("XX",
"XX_RAISE_EVENT_ERROR", tokens);

oadbTrx.rollback();
....
...
..
}

oadbTrx.commit();
....
...
..
}
}
}

Wednesday, 23 August 2006

Personalization and the MDS Database Repository

All declarative User Interface components are stored either in XML files, in a format defined by MDS (Meta Data Services) Schemas, or in the MDS repository tables. When a personalization is created through the OA Personalization Framework it is added on top of the base product meta data. The personalization does not overwrite the existing base product UI and are therefore preserved during upgrades and patches. The MDS repository is supported by the JDR_UTILS PL/SQL package, used to query and maintain the repository:

SQL> set serveroutput on
SQL>
begin
jdr_utils.listcustomizations
('/oracle/apps/icx/por/req/webui/ShoppingCartPG');
end;
/
/oracle/apps/icx/por/req/webui/customizations/site/0/ShoppingCartPG
/oracle/apps/icx/por/req/webui/customizations/org/44/ShoppingCartPG

PL/SQL procedure successfully completed.
SQL>

The MDS database repository consists out of four tables:
  • JDR_PATHS: Stores documents, packages and there parent child relationship.
  • JDR_COMPONENTS – Stores document components.
  • JDR_ATTRIBUTES – Stores attributes of document components.
  • JDR_ATTRIBUTES_TRANS – Stores translated attribute values of document components.

Thursday, 10 August 2006

SAOUG Conference 2006

Just got some good news, I have been accepted as a speaker at the South African Oracle User Group Conference 2006. I will be presenting my paper - "Oracle Applications Framework Development - The New Frontier", which is an introduction to the world of OAF development, personalization and extension. My presentation will be a 45 minute session scheduled for 9:55 AM Wednesday 27 September, so don’t miss it.

The conference is held at Sun City and runs from the 25th to the 27th of September, if you are interested in attending visit the SAOUG website at: http://www.saoug.co.za


Wednesday, 26 July 2006

Oracle Workflow Notifications & OAF

If you wanted to display HTML formatted content in an Oracle Workflow Notifications before the release of FWK.H you had to use one of the following options:

  • PLSQL Documents - 32K size limit
  • PLSQLCLOB Documents – CLOB

PL/SQL development of HTML notifications that contains tables and complex layouts can be difficult and very time consuming. It requires the developer to have a very good knowledge of HTML and makes the implementation of a standard “look and feel” very difficult.

With the implementation of FWK.H we are able to leverage the power of the OAF to create multifaceted Workflow notifications. Also called JRAD notifications, FWK embedded regions is nothing more then a normal OAF region displayed in the body of a Oracle Workflow notification.

Incorporating an embedded FWK region in a Workflow notification consists of the following steps:

  1. Create an OA Component Region containing the Headers, items and tables you want to display in the body of you notification. Developing and implementing this region is done in the exact same way you would when creating a region for an OAF custom page. Remember to create a dedicated Application Module (AM) for your region that will contain all the View Object (VO) required for your layout.
  2. In core applications, create a SSWA jsp function where the WEB HTML call is: OA.jsp?page=/companyabc/oracle/apps/xx/module /webui/XxRegionNameRN
  3. Create a new Workflow attribute:
WorkFlowAttribute

Value: JSP:/OA_HTML/OA.jsp?OAFunc=XX_PO_DOCUMENT_RN_NTFN &poHeaderId=-&PO_HEADER_ID-

XX_PO_DOCUMENT_RN_NTFN is the custom function created in core apps and &PO_HEADER_ID is a workflow attribute I am passing back as a parameter to the region's controller to initialize my VO.

4. Add the new attribute to your message:

WorkFlowAttribute

Save your workflow and initialize a new instance, the notification body should now be populated by the OAF region. No messy HTML coding, quick, easy and you can reuse the region in your OAF custom pages.


Tuesday, 18 July 2006

OAF and Oracle Workflow

Most of the custom development work I have done on OAF has required me to interact with Oracle Workflow, specifically to handle approvals and interfaces. The class oracle.apps.fnd.framework.webui.OANavigation provides Java wrappers for Oracle Workflow Engine's PL/SQL APIs.

The class is actually intended for use when creating and managing OA Framework Page Flows that are defined by Oracle Workflow, but can also be used to interface with Oracle eBS Workflows.

Example Code - Launching a custom Oracle eBS Workflow from a OAF page:

import oracle.apps.fnd.framework.webui.OANavigation;
import java.math.BigDecimal;

public void launchCustomWorkFlow(OAPageContext pageContext)
{
String wfItemType = "CUSTOM";
String wfProcess = "CUSTOM_PROCESS";
String wfItemKey = "1001-1";

OANavigation wfClass = new OANavigation();

// Create Workflow Process
wfClass.createProcess(pageContext, wfItemType, wfProcess, wfItemKey);

// Set Number Attribute: ITEM_INTERFACE_ID
wfClass.setItemAttrNumber(
pageContext,
wfItemType,
wfItemKey,
"ITEM_INTERFACE_ID",
new BigDecimal(1));

// Set Text Attribute:
ITEM_NAME
wfClass.setItemAttrText(pageContext, wfItemType, wfItemKey,
"ITEM_NAME", "ITEM1");

// Start Workflow Process
wfClass.startProcess(pageContext, wfItemType, wfProcess, wfItemKey);
}

Tuesday, 11 July 2006

Getting started with OAF development

I have recently received a number of queries related to OAF development, particularly regarding the quickest way to get started. I will handle these questions in a two part post, in the first I will aim to provide you with the basic software and documentation requirements to get started. In the second post we will have a look at a couple of common OAF extension tasks.

OAF development can be split into two major categories namely:

  • Personalization refers to the ability to declaratively alter the UI to suit user or business needs.
  • Extensibility refers to the ability to programmatically extend an application's functionality.

Personalization is the quickest and easiest way of altering the OAF UI, changes are protected from future upgrades and most personalization tasks can be performed by functional consultants or even trained users. If you have any requirement to alter the OAF UI, personalization should be your first stop. The following document will be of great help in understanding and implementing OAF personalization:

Metalink Doc ID: 236618.1 - OA Framework Personalization and Extensibility Guide: Version 5.7+

Extensibility is used when you are required to implement changes to functionality not provided by personalization, or when you are required to develop add-on/new functionality to the OAF UI.

The following steps will get you up to speed with the correct software and documentation:

  • Follow post: Find the right JDeveloper Patch for OAF development, once you determine the correct JDeveloper version for your development environment you can proceed to download the JDev patch from Metalink.
  • Once downloaded, follow the installation step set out in the OAEXT_README.txt document, located in the root directory of the patch file.
  • Oracle included excellent documentation with the JDeveloper patch, after installation you can locate the documentation index here: JDEV_INSTALL_DIR/jdevdoc/index.htm
  • Follow “You are Customer, Consultant or Support Representative” in Chapter 1: Setting Up your Development Environment of the OA Framework developers guide, make sure you complete all setup steps successfully.

Congratulations you have successfully installed and configured your new development tool, now it’s time to get into the documentation. I suggest you complete Chapter 1, 2 and 3 of the OA Framework developers guide.

You can then proceed with the Oracle Applications Framework ToolBox Tutorial, it is an excellent step by step introduction to OAF development and extension, and will introduce you to all the key concepts required for OAF customization.

Keep tuned for part 2: Include a new column - Extending a standard LOV view object.

Thursday, 29 June 2006

OAF - Tables and PPR

It has just taken me two days to implement PPR on a table, yes 2. I might be a little slow but the developers guide was of very little help and I was unable to find any worthwhile examples.

When planning to implement PPR in tables it is very important to decide early on what type of PPR you want to implement. Let’s take a step back, when implementing PPR on normal fields outside a table, there is only one instance of each field to modify. But when working in a table there might exist an infinite amount of rows each with an instance of the specific field.

If functionality requires that all instances of the PPR field behaves in the same fashion, PPR using SPEL bindings will work perfectly, and is very quick and easy to implement. On the other hand if you require each instance of the PPR field to act independently based on another value in its table row, you will have to look at Bound Values or Content Switcher.

In this post I will focus on Bound Values as this is the solution I implemented, the Dev guide specifies the following consideration when having to decide which solution to use:

“You should limit your use of Switchers to within tables, particularly when you want to switch between different kinds of web beans, such as a poplist or a checkbox. When you have only one type of web bean, but the value of an attribute on that web bean varies at runtime, then you should implement that attribute as a bound value rather than as a Switcher.”

PPR using Bound Values:
  • Add a transient attribute to your table view object; you will bind this attribute to the value of the PPR column’s RENDERED attribute.
  • Modify the transient attribute getter method to change the value depending on your PPR requirement. In my case I needed to render the Supplier Name field based on the value of the SupplierYn attribute in the table view object:

public Boolean getSupplierNameRendered()
{
String yn = getSupplierYn();
Boolean tf = Boolean.TRUE;

if ("Y".equals(yn))
{
tf = Boolean.TRUE;
}
else if ("N".equals(yn))
{
tf = Boolean.FALSE;
}

return (Boolean) tf;
}
  • Now bind the Supplier Name attribute to the transient attribute in the page controller’s processRequest method:
OAMessageLovInputBean supplierNameBean = (OAMessageLovInputBean) webBean.findIndexedChildRecursive(
"SupplierName");

supplierNameBean.setAttributeValue(
RENDERED_ATTR,
new OADataBoundValueViewObject(supplierNameBean,
"SupplierNameRendered", "SupplierVO1",
false));
  • The rendering of my attribute was based on the value of the attribute “SupplierYn” in the view object; to enable the updating change “Action Type” attribute to “fireAction”:

There it is four easy steps to enable PPR on a table.

Thursday, 22 June 2006

Viva le Resistance, Viva Mozilla!

Many of us are content to use IE for all our browser needs, but few know that there is an alternative. Mozilla Firefox is a open-source browser that some ten percent of the web uses, and which has been certified for use with Oracle EBS 11i.

I have been using Firefox for just more then a year, it is a very stable and well tested product that can be installed and immediately used as your main browser. There is also a number of plugin’s and extensions, Eddie Awad created a very useful plugin that allows you to search Metalink and Oracle Docs direct from your browser.

So, help stem the tide, go ahead, check it out.

Monday, 19 June 2006

Find the right JDeveloper Patch for OAF development

I have read a number of questions regarding what JDeveloper version should be used for OAF development. After a recent upgrade of our development system from 11.5.9 to 11.5.10 CU2, I did some research on Metalink and found the following info regarding JDeveloper versions:

Current JDeveloper patches:

  1. Patch 4045639 - 9IJDEVELOPER WITH OA EXTENSION ARU FOR FWK.H
  2. Patch 4141787 - 9IJDEVELOPER WITH OA EXTENSION ARU FOR CU1
  3. Patch 4573517 - Oracle9i JDeveloper with OA Extension for 11.5.10 CU2
  4. Patch 4725670 - 9IJDEVELOPER WITH OA EXTENSION ARU FOR 11i10 RUP3

To determine which patch to use, you can simply check the framework version in your instance by using http://host:port/OA_HTML/OAInfo.jsp, then choose the matched one.

11.5.10K = patch 4045639
11.5.101CU = patch 4141787
11.5.102CU = patch 4573517
11.5.103CU = patch 4725670

It would be interesting to have a survey regarding what framework versions are being used for OAF development. Please post your current development version in a comment; I will publish the results at a later stage.

Checkout Metalink note 416708.1 for the up to date list of OAF releases.

Blogging

The main aim of this Blog is to share my experiences as an Oracle e-Business Suite (EBS) developer. I will also from time to time blog about any subject that made me laugh, cry, angry or I feel would be of interest.

Just to get everybody thinking here is a short list of EBS topics I will be covering:

  • Oracle Application Framework Development, Extension and Personalization
  • Database Performance (Development Specific)
  • SQL & PL/SQL Concurrent Development
  • Open Interfaces and API's
  • Forms, Reports, CUSTOM Library development and customization
  • Workflow Development and Customization
  • Development Tools (JDev, Forms, Reports, TOAD, etc.)

All comments, anonymous or otherwise, fully appreciated.