22 September, 2018
This OAF Online Tutorial Lesson explains how to Extend Entity Object in Oracle Apps Framework (OAF) with one sample requirement, taking it as an example to explain EO Extension Process in OAF.
First of all, let us understand the requirement. We have one Responsibility called “OA Framework ToolBox Tutorial Labs”. If you don’t have that Responsibility go to System Administrator Responsibility -> User and add the Responsibility. The application for the OA Framework ToolBox Tutorial Labs is “Common Modules-AK”.
In the responsibility navigate to “Main Employee Search”.
OA Framework ToolBox Tutorial Labs -> Tutorial Lab -> Employees -> Main Employee Search
The Below Image shows the same Navigation Process:
After navigating to the Main Employee Search page we have a button called Create Employee. Whenever we click on Create Employee Button it will take us to another page, for creating an employee.
The below image, shows the Create Employee OAF page window, in the below image you can see that Email Address is highlighted. Let’s see the explanation after the image why it’s highlighted.
In the above image you might have observed that Email Address field is empty. So therefore here our requirement is we want the default email address as “email@example.com”.
Hence Email Address field is an attribute in OAF, we need to add a default value to the attribute. This can be done by extending EO where it contains all the attribute values. We can perform DML operations (INSERT, UPDATE, DELETE) only using EO. Here we need to set the default value of Email Address to “firstname.lastname@example.org”. Let us see how to extend EO step wise.
Step 1: Go to About this Page of Create Employee page. Extract the Business Component Reference Details. You can see the EmployeeEO.
Copy the EmployeeEO and create the same directory structure in JDeveloper patch, which is available in your desktop system.
The below image shows the sample way of creating the directory structure and copying the files from the Server to the JDeveloper patch.
Step 2: Open the JDeveloper and create new WorkSpace and Project.
Workspace Name : XXEOExtension
Project Name : XXEOExtensionPRJ
Default Package: xxeoextension.oracle.apps.fnd.framework.toolbox.labsolutions.webui
Note that we need to create the Default package name according to the path which we will see in about this page, we have a page path like as follows:-
We need to replace the Default package name according to the patch as follows:-
If you observe, we removed slash symbols, and also we removed the page name, and at the beginning, we have to give our own name like “xxeoextension”.
Step 3: After creating the dummy workspace and Dummy project, we will get a structure. Now create the Entity Object.
For example, give the Entity name as follows:
Name : EmployeeEOEx
Package : xxeoextension.oracle.apps.fnd.framework.toolbox.schema.server
In Extends Entity, select the Original EmployeeEO which you will find in browse because we created the same directory structure as it is in the server and also we copied from the server.
The below image shows the EO creation process Window.
After that whenever you click on Next button, you will not find any Entity Attributes:
To see the Attributes, click on the button called New From Table.., Using right arrow buttons move all the available Attributes into the selected list.
After that in the fourth step of EO creation process, check the Validation Method check box. The same scenario is shown in the below image:
Step 4: After creating EO open the Java File and add the two lines in create method. In the below code you need to add only two lines, line numbers 40 and 41. No need to do any changes for the remaining entire code.
Rebuild the code and then rebuild the entire project.
Step 6: Move the project file into the server. Go to MyClasses folder in JDeveloper patch move the XXEOExtensionPRJ file into the server Java top.
After moving the project file, note that we need to move even JPX file. Generally JPX file for the project is available in the same folder.
For example, move the JPX file from the MyClasses folder to the EOExtensionPRJ directory in the server.
After moving the project file and jpx files, run the import script.
java oracle.jrad.tools.xml.importer.JPXImporter $JAVA_TOP/xxeoextension/XXEOExtensionPRJ.jpx -username apps -password apps -dbconnection "(description = (address_list = (address = (community = tcp.world)(protocol = tcp)(host = www.newtonapples.com)(port = 1521)))(connect_data = (service_name = newton)))"
Step 7: Bounce the server or clear the Cache in Function Administrator responsibility. Sometimes even if you clear cache it will not workout. So therefore, if that the case then you must bounce the server.
Finally select the Create Employee button, so that you can see for the Email Address the default value as “email@example.com”. &nbps; You can see the changed Entity Object name in About This Page.
The below image shows the sample output.
Finally, we finished sample EO Extension process in OAF.
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills .