Professional Documents
Culture Documents
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 1 of 24
Rev 1
Job Title
Ownership
The Job Title [list@YourCompany.com?Subject=Practices for Lesson 3: Employee Business
Object: 030_Employee_Business_Object.doc] is responsible for ensuring this document is
necessary, reflects actual practice, and supports corporate policy.
Lesson Overview
This walk through describes how to define a new Business Object, starting with the creation of
the Business Entity Java class and then defining a simple Maintenance Object, along with the
infrastructure to add new objects of this type.
Lesson Objectives
By the end of this chapter, you will be able to:
Define a Business Object for a Maintenance Object that includes custom fields mapped to
an XML column.
Note that many of the names of definitions used in these exercises contain ZZ (e.g.
CM_ZZ_). The instructor may advise you to use your initials, or some other unique
identifier, in place of ZZ to prevent conflicts with the definitions of other students.
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 2 of 24
Rev 1
Tasks
1.
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 3 of 24
Rev 1
Type the new package name com.splwg.cm.domain.hr in the Name field and click
Finish.
It is VERY IMPORTANT that you always work in the java folder in this project, and NOT the gen folder.
The gen folder is reserved for the Artifact Generator. If you accidentally create files in the gen folder,
they will be erased when you next run the Artifact Generator.
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 4 of 24
Rev 1
On the New dialog, select the Entity wizard under the Oracle Utilities, Customizations
node and click Next
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 5 of 24
Rev 1
The New Entity wizard dialog will show. Populate it as shown below and click Finish
(confirm with the instructor what you should substitute for ZZ in these names)
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 6 of 24
Rev 1
Now run Artifact Generator to generate CmZZEmployee_Gen and the rest of the
supporting files. Click on the Run button
and select the _Generate Artifacts run configuration (the name will be prefixed with the
name of your project, Training in the example below)
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 7 of 24
Rev 1
Monitor the artifact generation run in the Console view and wait for it to end
Verify that the following Java files were generated in the gen folder
Click on the Training project and hit F5 to refresh (and compile) the project. This should
generate the binary code for the newly created java files.
The Business Entity for Employee should now be created and there should be no errors
in the project
You have now created your first business entity. In the next walk through you will create an
entity page maintenance that uses this new business entity.
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 8 of 24
Rev 1
Tasks
1.
Create the Employee Entity Page Maintenance Java file and generate the service XML. As
with the creation of the Business Entity in the previous walk through, select the
com.splwg.cm.domain.hr package so that it is highlighted and click the New button. On
the New dialog, select the Page Service wizard and click Next
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 9 of 24
Rev 1
Populate the fields as shown here and click the Edit DataElement button
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 10 of 24
Rev 1
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 11 of 24
Rev 1
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 12 of 24
Rev 1
Continue clicking Finish to close all the dialogs until the New Page Service dialog again
has the focus, then click the Add button next to the Modules text box
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 13 of 24
Rev 1
Note that the module code of DV is being added here to work around a problem with this
wizard. For customizations, the module code should in fact be empty, but the wizard does
not generate it at all unless it contains a value. You will manually correct this in the
generated annotation in the source code shortly.
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 14 of 24
Rev 1
Now remove the modules value so that the annotation looks as follows (note that the
red-encircled text above, including quotes, has been removed)
2.
Monitor the Console view and when it is finished, click on the Training project and hit F5
to refresh (and compile) the project.
Verify that the following Java files were generated in the gen folder.
Build and deploy the cm.jar containing your new custom programs to the web application
server.
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 15 of 24
Rev 1
Shutdown your web application server. Your instructor will assist with this if needed.
The application must be shutdown now because in the following steps you will update
the SPLService.ear file and restart the application server.
and select the _Deploy CM run configuration (the name will be prefixed with the name
of your project, Training in the example below)
Monitor the Console view. It should take no more than a few seconds and should look
similar to the screenshot below when completed.
Restart the Web application server. Again, ask the instructor for assistance if required.
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 16 of 24
Rev 1
Tasks
1.
Launch the application using the URL and user Id and password provided by the instructor
E.g. http://localhost:4410/spl/cis.jsp
2.
Open the Service Program page in add mode (Admin menu) and supply the following
Service Name:
Description:
Service Type:
3.
Open the Application Service page in add mode (Admin menu) and supply the
following
Application Service:
Description:
CMZZEMPP
ZZs Employee Application Service
Access Mode
Add
Change
Delete
Inquire
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 17 of 24
Rev 1
Select the Application Security tab. Locate the ALL_SERVICES group in the User
Groups Without Access zone. Click the Grant Access button. You will be navigated to
the User Group Maintenance for ALL_SERVICES. Wait until you see your application
service name.
Set the expiration date to 1/1/2100. Add the following access modes.
Add
Change
Delete
Inquire
Flush all caches and refresh your application page to ensure the new security settings
are available. For example
http://localhost:4410/spl/flushAll.jsp
4.
Open the Maintenance Object page in add mode (Admin menu) and supply the
following
Maintenance Object:
Description:
Program Com Id:
Service Name:
CMZZEMPLOYEE
ZZs Employee Maintenance Object
CIPYPGDJ
CMZZEMPP
Table
CM_ZZ_EMPLOYEE
Table Role
Primary
BO Maintenance (Y/N)
10
Y
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 18 of 24
Rev 1
Determine BO
10
F1-STD-DTMBO
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 19 of 24
Rev 1
Tasks
1.
Create two additional fields that will be mapped to XML columns in the CLOB.
Open the Field page in add mode (it's on the Admin menu) and add the following field
definitions:
Field Name:
Data Type:
Precision:
Description:
Java Field Name:
CM_ZZ_HOME_PHONE
Character
16
CM ZZ Home Phone
cmZZHomePhone
CM_ZZ_EMAIL
Character
60
CM ZZ Email
cmZZEmail
Open the Business Object page in add mode (it's on the Admin menu) and set the
following data on the Main tab:
Business Object:
Description:
Maintenance Object:
Application Service:
Instance Control:
CM_ZZ_EmployeeBO
CM ZZ Employee Business Object
CMZZEMPLOYEE
CMZZEMPP
Allow new instances.
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 20 of 24
Rev 1
Select the Schema tab. In the Dashboard, locate the BO Schema zone, and click the
Generate button. The Schema Editor zone will be updated with the generated schema.
Add two additional fields, inside a group element named employeeDetail, mapped to
the CM_ZZ_EMP_DATA_AREA field.
element name:
mdField:
cmZZHomePhone
CM_ZZ_HOME_PHONE
element name:
mdField:
cmZZEmail
CM_ZZ_EMAIL
Like this:
<cmZZEmployeeDetail type="group" mapXML="CM_ZZ_EMP_DATA_AREA">
<cmZZHomePhone mdField="CM_ZZ_HOME_PHONE"/>
<cmZZEmailAddress mdField="CM_ZZ_EMAIL"/>
</cmZZEmployeeDetail>
Look for the version element. Add the attribute suppress=true after
mapField=VERSION. This will ensure that no text box will be generated on the UI
this field should not be editable on a UI.
Save your work
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 21 of 24
Rev 1
Tasks
1.
Open the UI Map page in add mode (it's on the Admin menu) and set the following data
on the Main tab:
UI Map:
Map Type:
Description:
CM_ZZ_EmployeeMaint
Complete HTML Document
ZZs Employee Maintenance UI Map
In the Schema Editor tab, update the schema to include your BO:
<schema>
<includeBO name="CM_ZZ_EmployeeBO"/>
</schema>
Save your work
In the Dashboard, locate the Generate HTML zone, and click the Input Map button.
Click OK if prompted by Confirm: Overwrite existing information? The HTML Editor
zone will be populated with a UI map definition.
Save your work
2.
Click the Test UI Map link to see what your UI map looks like.
Open the Script page in add mode (it's on the Admin menu) and set the following data
on the Main tab:
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 22 of 24
Rev 1
Script:
Description:
Script Type:
Accessibility:
Application Service:
Script Engine Version:
cmZZAddEmp
CM ZZ Add Employee
BPA Script
Accessible from Script Menu
F1-DFLTAPS
1.0
Select the Data Area tab and add your UI Map object:
Schema Type:
UI Map
Object:
CM_ZZ_EmployeeMaint
Save your work
2.
Execute your BPA script. Find the Favorite Scripts zone in the Dashboard. Click the
Search link.
Search for your BPA script, named CM ZZ Add Employee. Click it to execute.
Your UI map should be displayed in the page area. Enter values for employee ID,
name fields, etc. and click the Save button. If the BPA goes away, your Employee data
has been saved. If not, the UI map should be redisplayed with error information.
Correct the problem and submit again.
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 23 of 24
Rev 1
Review Questions
030_EMPLOYEE_BUSINESS_OBJECT.DOC
Page 24 of 24
Rev 1