0% found this document useful (0 votes)
12 views8 pages

Oracle BC4J Employee Management Setup

Oracle Application Guide - step by step document with screenshots (EBS 11i)

Uploaded by

jagan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views8 pages

Oracle BC4J Employee Management Setup

Oracle Application Guide - step by step document with screenshots (EBS 11i)

Uploaded by

jagan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DAY 3 & 4

1. Create a BC4J package - [Link]


2. Create an EO Object EmployeesNewEO based on the Table employees_new
3. Create a BC4J package - [Link]
4. Create a VO EmployeesNewVO based on the EO EmployeesNewEO in the
package
[Link]

5. Create an AM EmployeeCreateAM in [Link]

6. Associate EmployeesNewVO with EmployeeCreateAM

7. Create a page EmployeeCreatePG in the package


[Link]

8. Set the AM property of EmployeeCreatePGPageLaout region to


EmployeeCreateAM

9. Set the Window Title and Title property of PageLaout region to Create Page

10. use the Wizard to create a Form with Region Style as ‘header’

11. Add the following items as ‘SubmitButton’

a. New
b. Save
c. Cancel
12. Add a controller to the EmployeeCreatePGPageLaout region
a. Name :EmployeeCreateCO
13. Add the following code to demonstrate the Submit button handling
public void processFormRequest(OAPageContext pageContext, OAWebBean
webBean)
{
[Link](pageContext, webBean);

if([Link]("New")!=null){
[Link]("New Button Pressed");
}

}
14. Add the following method to the AM EmployeeCreateAM

public void createButtonMethod(){


EmployeesNewVOImpl employeeVO =
(EmployeesNewVOImpl)getEmployeesNewVO1();
[Link]();
EmployeesNewVORowImpl row =
(EmployeesNewVORowImpl)[Link]();
[Link](row);
[Link](row);
getOADBTransaction().postChanges();
}
15. Use the Sequence employee_new_seq to populate the employee id
public void create(AttributeList attributeList)
{
[Link](attributeList);
Number employeeId =
getOADBTransaction().getSequenceValue("employee_new_seq");
setEmployeeId(employeeId);
}

16. public void processFormRequest(OAPageContext pageContext, OAWebBean


webBean)
{
[Link](pageContext, webBean);
OAApplicationModuleImpl am =
(OAApplicationModuleImpl)[Link](webBean);
if([Link]("New")!=null){
[Link]("New Button Pressed");
[Link]("createButtonMethod");
}

import [Link];

17. Controller
if([Link]("New")!=null){
[Link]("New Button Pressed");
[Link]("createButtonMethod");
}

if([Link]("Save")!=null){
[Link]("Save Button Pressed");
[Link]("saveMethod");
}

[Link] [Link] BC4J package

[Link] a VO ManagerLovVO in [Link] package with Query

select last_name , employee_id , email from employees_new

[Link] a LOV region in the package [Link]


Make the scope of LOV region as Public

[Link] click on the LOV region to create a table using the Wizard – Select the
EmployeesNewVO and add the Columns – LastName , Email and EmployeeId

[Link] the LOV fields as Search allowed as TRUE

[Link] manager id Field on the Page as MessageLovInput and Associate the LOV
region we created as an External LOV region

[Link] the following LOV mapping

:Base Item : ManagerId


Lov region Item : EmployeeId
Criteria Item : ManagerId
-----------------------------------------------------------------
[Link] a Result Based Search Page – EmployeesSearchPG on the VO
EmployeesNewVO1

[Link]

Set the AM of the page and ‘Title and Window title’

Add a Query region to the Page . and Set the following attributes as shown
26. Create a Column in EmployeSearchPG with type as Image name

updateicon_enabled.gif

Destination URI :
[Link]?page=/oracle/apps/ak/employeecreate/webui/
UpdateEmployeePG&retainAM=Y&EMP_ID={$EmployeeId}

[Link] a Update page – UpdateEmployeePG and use a wizard to create an update


Form .

Associtate with AM and set ‘Window Title and Title’

Create a CO for UpdateEmployeePG as UpdateEmployeeCO in the package

[Link]

add a submitButton – with name as ‘Update’ .

28. Add the following method to [Link]

public void updateMethod(){


getOADBTransaction().commit();
}

public void findByEmpId(String empId){


EmployeesNewVOImpl employeeVO =
(EmployeesNewVOImpl)getEmployeesNewVO1();
[Link](null);
[Link]("EMPLOYEE_ID='"+empId+"'");
[Link]();
}

[Link] the below code to UpdateEmployeeCO

public void processRequest(OAPageContext pageContext, OAWebBean webBean)


{
[Link](pageContext, webBean);
[Link]("Employe Id :"+[Link]("EMP_ID"));

String empid = [Link]("EMP_ID");


OAApplicationModule am = [Link](webBean);

[Link]("findByEmpId", new String[]{empid});

}
import [Link];
[Link] the following piece of code to processFormRequest method of the
UpdateEmployeeCO

import [Link];
import [Link];

public void processFormRequest(OAPageContext pageContext, OAWebBean


webBean)
{
[Link](pageContext, webBean);

OAApplicationModule am = [Link](webBean);
if([Link]("Update")!=null){
[Link]("updateMethod");
[Link]("[Link]?page=/oracle/apps/ak/employeecreate/
webui/EmployeeSearchPG",null,OAWebBeanConstants.KEEP_MENU_CONTEXT
,null,null,true,OAWebBeanConstants.ADD_BREAD_CRUMB_YES,OAWebBea
nConstants.IGNORE_MESSAGES);
}
}

Day 5

[Link](
"[Link]?page=/oracle/apps/ak/employeecreate/webui/EmployeeSearchPG"
,null // functionName
,OAWebBeanConstants.KEEP_MENU_CONTEXT // menuContextAction
,null // menuName
,null // parameters
,true // retainAM
,OAWebBeanConstants.ADD_BREAD_CRUMB_YES // addBreadCrumb
,OAWebBeanConstants.IGNORE_MESSAGES // messagingLevel
);

31. Add a Item in EmployeeSearchPG with item style as image and

Image URI : deleteicon_enabled.gif

Add Fire action to Delete Button

Add the following parameters to the Delete button


Name :DELETE_EMP_ID
Value : ${[Link]}

[Link] deleteEmployee method to the EmployeeNewAMImpl

public void deleteEmployee(String empId){


EmployeesNewVOImpl employeeVO =
(EmployeesNewVOImpl)getEmployeesNewVO1();
[Link](null);
[Link]("EMPLOYEE_ID='"+empId+"'");
[Link]();
EmployeesNewVORowImpl row =
(EmployeesNewVORowImpl)[Link]();
if(row!=null){
[Link]();
}
getOADBTransaction().commit();
[Link](null);
[Link]();
}

32. Create a Controller for the EmployeeSearchPG in the package


[Link]

Name :EmployeesSearchCO

[Link] the Foll changes to [Link]

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)


{
[Link](pageContext, webBean);
if([Link]("DELETE_EMP_ID")!=null)
{
[Link]("Employe Id :"+[Link]("DELETE_EMP_ID"));

String empid = [Link]("DELETE_EMP_ID");


OAApplicationModule am = [Link](webBean);

[Link]("deleteEmployee", new String[]{empid});


}
}

Common questions

Powered by AI

The Oracle application employs several strategies for handling user input errors and maintaining data integrity. These include strict validation rules within the entity objects, where attributes are checked for correctness before committing transactions. Application methods like updateMethod include commit operations through OADBTransaction to ensure atomic transactions only finalize if all conditions are met. Additionally, user interfaces are designed to provide immediate feedback on input errors, enhancing data integrity from the front end.

Sequences like employee_new_seq are used to generate unique numerical values for new employee records automatically. This sequence is utilized within the create method of the entity object to assign a unique EmployeeId to each newly created row by fetching the next value in the sequence through the getOADBTransaction().getSequenceValue method. This ensures that every employee record has a stable, unique identifier.

In the OA Framework, navigation and redirection are handled by methods such as setForwardURL. For example, in the UpdateEmployeeCO's processFormRequest, upon executing the updateMethod successfully, the page context is set to forward to the EmployeeSearchPG using pageContext.setForwardURL. This method call includes parameters for context retention, breadcrumb configuration, and message settings to ensure smooth navigation between pages, maintaining user session context and UI consistency.

Integration of a List of Values (LOV) in the Oracle web application involves creating a VO ManagerLovVO that executes a query selecting specific columns from the employees_new table. A LOV region is created in the web UI with public scope where the LOV fields are set to allow search. In the LOV region, the VO is linked, and columns are added. The LOV is then associated as an external region to a MessageLovInput field on the page, with mapping defined for base items and criteria items.

Controllers in the OA Framework, such as EmployeeCreateCO or UpdateEmployeeCO, facilitate enhanced form handling and user interaction by managing form submissions and defining actions based on user inputs. They act as a bridge between the user interface and the application logic, handling specific operations like invocation of methods for creating, updating, or deleting records upon button triggers, thereby streamlining the workflow and ensuring business rules are enforced consistently.

The createButtonMethod is used to instantiate and prepare a new employee record for insertion. In the user interface, this method is triggered upon the selection of the 'New' button. The method calls EmployeesNewVOImpl to create and insert a new row, setting it as the current row, followed by committing the transaction to reflect changes in the database. The user interface reflects this by allowing new data entry fields to appear for the new employee details.

The delete operation is implemented through the deleteEmployee method, which searches for a record by setting a where clause with the given EmployeeId. If the record is found, it is removed from the EmployeesNewVOImpl object, followed by committing the transaction. This ensures the record is deleted from the database. The process is triggered through a Delete button on the EmployeeSearchPG, which passes the EmployeeId as a parameter to the application module method.

Creating a page layout involves setting the AM property of the PageLayout region to the respective application module (AM), such as EmployeeCreateAM. This page, EmployeeCreatePG, is created in the oracle.apps.ak.employeecreate.webui package, and it requires the AM to manage transactions and maintain business logic. The setup ensures proper data handling and binding between the layout elements and the underlying database schema.

UpdateEmployeePG enables updates to employee data by using a form created by the wizard that is tied to the application module. The critical components include the controller UpdateEmployeeCO, which handles the update form request, and the update method in EmployeeNewAMImpl.java that commits changes to the database. A submit button named 'Update' triggers these processes, linking with the page context to forward updated values appropriately.

The EmployeeCreateAM handles new employee creation by executing the createButtonMethod. This method leverages the EmployeesNewVOImpl object to create a new row, insert it, and set it as the current row. The method ends by posting the changes through the OADBTransaction to ensure that the new record is saved into the database.

You might also like