Tuesday, May 12, 2020

OAF - Introduction

About Oracle Application Framework

Oracle Application Framework (OAF) is an architecture for creating web based front end pages and J2EE type of applications within the Oracle EBS ERP platform.Oracle Application Framework is the development and deployment platform developed by Oracle to develop the Oracle E-Business Suite “Self-Service” or HTML based Applications.
OA Framework, is based on the industry-standard Model-View-Controller(MVC) design pattern and can be used to develop extensions to existing E-Business Suite functionality. Oracle Application (OA) enables you to personalize the layout of the user interface and the content it displays to suit your business needs. Oracle’s JDeveloper tool with an Oracle Applications extension is used for development for the Oracle Applications Framework and uses Java & XML languages for the same.
Oracle Application Framework (OA Framework or OAF) is a framework developed by Oracle Corporation for application development within the Oracle E-Business Suite (EBS)
Oracle Application Framework (OAF) provides visual and declarative approaches to Java EE development. The OA framework is also available to customers for personalization’s, customizations and custom-application development.
- The OA Framework helps to create self Service pages in Oracle EBS.
- The OA Framework helps in controlling the flow of the application.
- OA Framework works on the basic Java EE principles.
- To Learn OAF you must know the Basics of Java like Core Java.
- User Interface is Very Interactive in OAF
- OA Framework contains inbuilt security
- We can view OA Framework pages in mobile phones too which contains Internet browsing feature
- OA Framework is J2EE based but it also supports various standards like HTML, XML, SQL, JSP.
oaf-overview
OA Framework is based on J2EE technology called BC4J (Business Components for Java) The OA Framework is a Model-view-controller (MVC) framework built using J2EE (Java 2 Platform, Enterprise Edition) technologies.
OAF Components

Oracle Application Framework Components

The MVC architecture is a component-based design pattern with clean interfaces between the Model, View, and Controller.
The Model is where the application implements its business logic. All the BC4J components in OAF comes under Model like AM (Application Module), VO (View Object), EO (Entity Object), VL (View Link) & AO (Association Object).
EO(Entity Objects) Entity Object is based on database table or other data source.Entity Object contains attributes which represent database columns.All insert/update/delete (DML Operations) transactions go through EO to database.
VO View Objects are based on EO or SQL Query which is again based on EO Objects Two types 1. SQL based 2. EO based Basically VO is synonymous to views used in PLSQL Programming they are used for joining tables, filtering based on conditions and sorting the data. Entity Objects can be based on any number of EO and provide access to EO.
Application Module Its a container for VO. Once you create a Application Module you need to associate the corresponding VO to the Application Modules. Access to the VO is always provided through the Application Module. Every Page in OAF Framework need to be associated with a AM.
The View is where the application implements its user interface. View means the UI (User Interface) that is visible to the Users.
The Controller is where the application handles user interaction and directs business flow. Controller is a simple java class file that contains methods for initial page request and post back request.
When user clicks a button, or performs certain action what responses should be triggered is coded in the Controller. All the responses to User actions, Application Flow is coded into the Controller. m Model objects like EO and VO can't be accessed directly from the Controller Class, except AM.
Some common methods that controller has 
1. ProcessRequest: Fires when OAF page loads for the first time 
2. ProcessFormRequest: Fires when user submits the page.


Oracle Application Framework Uses

The necessary to use OAF in Oracle applications is Integration, Security, and Customization. Integration:  Registration of Forms is easy. Security: Flexibility reasons if we are using third party we don’t know when it is going to fail.
Customization: If we are integrating with third party customization is tough where as using OAF customization is little bit easier when comparing to Other Third party customization.


OAF Advantages & Disadvantages

Advantages of OAF:

1) End user Productivity 2) Enterprise Grade Performance and Scalability 3) Highly extensible Architecture 4) Browser Look and Feel of all the pages in application. 5) Open Standards such as XML, HTML, Java, JSP, SQL, and Web Services. 6) Application Customizability. 7) Developer Productivity.

Disadvantages of OAF:

1) Cannot see the layout at design time. 2) OAF Pages are integrated / compatible only with the Oracle Apps. 3) Drag and Drop options are not available. 4)  More R&D is required to design a form layout which is time consuming.

Structure of OAF

OAF follows J2EE Architecture, and J2EE follows MVC architecture so therefore ultimately OAF follows MVC Architecture.
The abbreviation of MVC is Model View Controller.
MVC is the clean design interface between Model, View, and Controller.
Structure of OAF
Model will take care the Data Base related Transactions, Model contains the following:
Entity Object (EO)
View Object (VO)
Callable Statement (PL/SQL Statement)
Prepare Statement (Single Select Statement)
OADB Transactions (Oracle Apps Data Base Transactions)
View is nothing but the OAF Page Output. View is implemented by UIX (User Interface XML).
Controller will take care of web browser activities like HTTP Get and HTTP Post
Controller has got three methods:
Process Request
Process Forms Request (HTTP Get)
Process Form Data (HTTP Post)
HTTP get: While loading the Page we use HTTP Get.
HTTP Post : After Loading the page if we want any changes we use HTTP Post.
We will discuss in detail about MVC architecture in the next chapters.
The Below figure shows the interaction between Model, View, and Controller.
controller
Onion Structure of OAF
Another structure of OAF is called Onion structure.
The OA Framework can be extracted into a series of concentric layers.
Each layer knows only about the layers below to them.
The below figure shows the Onion Structure, in which AM interacts with the VO and VO interacts with EO and finally, EO interacts with Database.
OAF

Differences Between OAF and Oracle FORMS

The below table lists out the differences between OAF and Oracle Forms.
                             OAF              Oracle FORMS
OAF Follows MVC architecture and Client ServerArchitecture Forms Follows only Client Server Architecture
OAF pages are light weight components Forms are not light weight
OAF Pages can send through mobile devices Cannot send to mobile devices
OAF Pages can connect in Oracle Apps Local Machine Cannot (NOT APPLICABLE)
Look and Feel is good Not better when comparing to OAF
OAF pages are integrated with the Java Top Forms are integrated with Application Top
Commit always takes place in the Application Module’s (AM) Java code. When a commit takes place, the data from OA Framework Cache is transferred to the database. The COMMIT_FORM or DO_KEY(‘COMMIT_FORM’) commands can be invoked from any trigger that allows restricted procedures.
A page is divided into regions. Regions contain fields, buttons, tables, and other components. A form is divided into blocks; blocks contain the fields, buttons, and other components

Creating First OAF Page in Project

This article, “OAF Hello World example” will help you learn how to Develop Hello world page OAF Page.
  1. Create new OA Workspace and Project
  2. Set Project properties
  3. Create Application
  4. Develop OAF Helloworld page
  5. Run OAF Page
1. Create New OA Workspace and Project
Right click on Applications node and select New OA Workspace
Give the workspace name and browse the directory name. All the files related to the Workspace will be saved in myprojects folder now.
Give the details as below to create a helloworld project.
Provide the connection details
DBC file : D:OAFjdevhomejdevdbc_filessecureVIS.dbc
E business suite Username/password
Responsibility: The given responsibility should be attached to the given user

2. Set Run Options in OA Project Setting
Select Oracle Applications > Run Options
Select OADeveloperMode and OADiagnostic, and move them to selected Options List

3. Create an Aplication Module

4. Create a Hello World Page
Page Layout region will be created automatically. Set the region properties as below.
Create a new region.

Set the region properties as below
Property NameValue
IDMainRN
Region StylemessageComponentLayout
Create new TextInput item to enter the text value.
Set the item properties as below
Property NameValue
IDNameID
Item StylemessageTextInput
PromptName
Length20
Create button layout region.
Set the item properties as below
Property NameValue
IDButtonLayout
Create an Item GO Button
Select ButtonLayout > New > Item

Set the item properties as below
Property NameValue
IDGO
Item StylesubmitButton
Attributes
Save your work and Run the page
Add a Controller to the page.
MainRN -> Set New Controller
Add below coding part to the Controller file to display the text data on page.
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
if (pageContext.getParameter(“GO”) != null)
{
String userContent = pageContext.getParameter(“NameID”);
String message = “Hello, ” + userContent + “!”;
throw new OAException(message, OAException.INFORMATION);
}
}
5. Run OAF Page
Right click on page and click Run to run the page locally.
Page gets loaded as below
Enter a string in Name field and click Go
What ever you typed in Name field will appear as Information which is highlighted.

HZ Tables in R12


This article describes few important HZ tables in R12 and their relationships with each other.

HZ_PARTIES:
The HZ_PARTIES table stores basic information about parties that can be shared with any relationship that the party might establish with another party. The primary key for this table is PARTY_ID.
Few Important Columns are
  • PARTY_ID: Party identifier
  • PARTY_NUMBER: Unique identification number for this party
  • PARTY_NAME: Name of the party
  • PARTY_TYPE: The party type can only be Person, Organization, Group or Relationship.
HZ_PARTY_SITES:
The HZ_PARTY_SITES table links a party (HZ_PARTIES) and a location (HZ_LOCATIONS) and stores location-specific party information. One party can optionally have one or more party sites. One location can optionally be used by one or more parties. The primary key for this table is PARTY_SITE_ID.
Few Important Columns are
  • PARTY_SITE_ID: Party site identifier.
  • PARTY_ID: Identifier for the party. Foreign key to the HZ_PARTIES table.
  • LOCATION_ID: Identifier for the party site. Foreign key to the HZ_LOCATIONS table.
  • PARTY_SITE_NUMBER: Party site number.
  • PARTY_SITE_NAME: User-defined name for the site.
  • ADDRESSEE: Addressee information.
HZ_LOCATIONS:
The HZ_LOCATIONS table stores information about a delivery or postal address such as building number, street address, postal code, and directions to a location. This table provides physical location information about parties (organizations and people) and customer accounts. The primary key for this table is LOCATION_ID.
Few Important Columns are
  • LOCATION_ID: Unique identifier for this location
  • COUNTRY: Country code from the TERRITORY_CODE column in the FND_TERRITORY table
  • ADDRESS1: First line for address
  • ADDRESS2: Second line for address
  • ADDRESS3: Third line for address
  • ADDRESS4: Fourth line for address
  • CITY: City
  • POSTAL_CODE: Postal Code
  • STATE: State
  • ADDRESS_KEY: Derived key that facilitates fuzzy searches
HZ_CUST_ACCOUNTS:
The HZ_CUST_ACCOUNTS table stores information about customer accounts , or business relationships that the deploying company establishes with a party of type Organization or Person. This table focuses on business relationships and how transactions are conducted in the relationship. Since a party can have multiple customer accounts, this table might contain several records for a single party. For example, an individual person can establish a personal account, family account, and a professional account for a consulting practice. The primary key for this table is CUST_ACCOUNT_ID.
Few Important Columns are
  • CUST_ACCOUNT_ID: Customer account identifier
  • PARTY_ID: A foreign key to the HZ_PARTY table.
  • ACCOUNT_NUMBER: Account Number
  • CUSTOMER_TYPE: Receivables lookup code for the CUSTOMER_TYPE attribute. I for internal customers, R for revenue generating external customers.
  • CUSTOMER_CLASS_CODE: Customer class identifier
HZ_CUST_ACCT_SITES_ALL:
The HZ_CUST_ACCT_SITES_ALL table stores all customer account sites across all operating units. Customer account sites are addresses, for customer accounts, where the deploying company does business with its customers. One customer account can have multiple customer account sites, and customer account sites for one customer account can belong to multiple operating units. The primary key for this table is CUST_ACCT_SITE_ID.
Few Important Columns are
  • CUST_ACCT_SITE_ID: Customer site identifier
  • CUST_ACCOUNT_ID: Identifier for a customer account. Foreign key to the HZ_CUST_ACCOUNTS table
  • PARTY_SITE_ID: Identifier for a party site. Foreign key to the HZ_PARTY_SITES table
  • BILL_TO_FLAG: Indicates if this is a Bill-To site.
  • SHIP_TO_FLAG: Indicates if this is a Ship-To site.
  • MARKET_FLAG: Indicates if this is a Marketing site.
HZ_CUST_SITE_USES_ALL:
The HZ_CUST_SITE_USES_ALL table stores business purposes assigned to customer account sites, for example Bill-To, Ship-To, and Statements. Each customer account site can have one or more purposes. This table is a child of the HZ_CUST_ACCT_SITES_ALL table, with the foreign
key CUST_ACCT_SITE_ID. The HZ_CUST_SITE_USES_ALL table also stores operating unit identifier, though the HZ_CUST_ACCT_SITES_ALL table itself stores the operating unit for customer account sites. The primary key for this table is SITE_USE_ID.
Few Important Columns are
  • SITE_USE_ID: Site use identifier
  • CUST_ACCT_SITE_ID: Identifier for the customer account site. Foreign key to the HZ_CUST_ACCT_SITES_ALL table
  • SITE_USE_CODE: Business purpose assigned to customer site account, such as Bill-To, Market, and Statements.
  • PRIMARY_FLAG: Indicates if this site is the primary site for this customer account. Y for the primary customer account site. N for other customer account sites.
HZ_CUSTOMER_PROFILES:
The HZ_CUSTOMER_PROFILES table stores information about the credit characteristics of a single customer account or a customer account site or a party. A profile class defined in the
HZ_CUSTOMER_PROFILE_CLASSES table can be used to provide default values for the attributes in this table. The primary key for this table is CUST_ACCOUNT_PROFILE_ID.
Few Important Columns are
  • CUST_ACCOUNT_PROFILE_ID: Unique identifier of this customer profile
  • CUST_ACCOUNT_ID: Identifier for the Customer Account. Foreign key to the HZ_CUST_ACCOUNTS table.
  • STATUS: Indicates whether the profile is active or inactive
HZ_CUST_PROFILE_CLASSES:
The HZ_CUST_PROFILE_CLASSES table stores information about the credit characteristics that are common across a group of customer accounts. The characteristics specified in this table can be used as default characteristics for similar customer accounts. The primary key for this table is PROFILE_CLASS_ID.

HZ_PARTY_RELATIONSHIPS:
The HZ_PARTY_RELATIONSHIPS table stores information about relationships between parties.