4

Business Objects

Copyright © 2009, Oracle. All rights reserved.

Business Objects Are Logical Views of Maintenance Objects
MO’s are abstract to handle disparate
requirements (for example, the Person object
doesn’t have a column called "daytime phone")

Business object’s are not abstract, notice
how each has specific fields

Person Maintenance Object (MO)

Person

Person
Name

Person
Char

Person Id

Person
Phone

Id Type

Phone Type

Char Type

Individual Taxpayer
Busines
s
Objects








Legal name
ID (e.g. driver’s license)
Commercial Customer
Birth date
• Name
Spouse
• Tax ID
Number of dependents
Daytime phone• Primary SIC code
Evening phone• Accounting phone nbr
• Service phone nbr
Mailing address
• Mailing address
• Credit issues address

They closely represent the business
They are easy to access using the configuration tools (i.e.,
you can easily add, change, delete and read BO’s)
They are true subclasses of the MO and therefore take advantage of the
rich, safe, and sophisticated business rules embodied in the base-package
MO’s
4-2

Copyright © 2009, Oracle. All rights reserved.

Foreshadowing – One Reason To Create A BO Is To
Simplify The User’s Experience
This page shows the person
MAINTENANCE OBJECT

This zone shows a customer BUSINESS
OBJECT (and it's fairly easy to create this
zone after you've set up a business object)
4-3

Copyright © 2009, Oracle. All rights reserved.

Foreshadowing – Other Reasons To Use BO's
• BO's are much more than visual definitions of objects;
you'll soon find out that you can:
• Introduce BO-specific business rules without coding in Java
• Populate and retrieve effective-dated attributes without
complicated joins to effective-dated table
• Set up default values for BO attributes
• Hide base-package attributes that must be populated but aren't of
interest to a customer
• Extend objects without the need for new tables and columns
• Enable the generation of HTML that reflects each element's data
type
• Allow external systems to communicate with our system in a more
natural way (rather than in a 3rd normal form way)
• And much more…

4-4

Copyright © 2009, Oracle. All rights reserved.

we have to describe how to configure business objects • This discussion is long and deals with abstract concepts • We ask you to be patient as you'll soon learn how to "reap the rewards" 4-5 Copyright © 2009. Oracle.An Apology • We've just described some of the many benefits of business objects • Before we can describe how to take advantage of these benefits. All rights reserved. .

. Oracle. Business Objects Copyright © 2009.4 Business Objects Maintenance Objects vs. All rights reserved.

.Maintenance Objects vs. etc. a tax management implementation could set up BO’s for individual taxpayers. All rights reserved. Oracle. partnerships. corporations. Business Objects MO's are designed to be abstract and generic so that they can be used in multiple geographies and vertical markets Person Maintenance Object (MO) Person Person Name Person Id Individual Taxpayer BO Individual Taxpayer ID Name E-mail SSN Home Phone Date of Birth Dependents 4-7 Person Char Person Phone Business objects are designed to match the business. rather than work with the generic person MO Corporation BO Corporate Taxpayer ID Corporate Name Employer ID Main Phone Date of Incorporation Corporate Officers Copyright © 2009. For example.

Oracle.A Maintenance Object Has Fields. All rights reserved. A Business Object Has Elements • We use the term element to describe an individual piece of information that a BO holds • Foreshadowing .we use this term rather than "field" or "column" because you communicate with BO’s via XML documents (and XML documents contain elements) Individual Taxpayer Individual Taxpayer elements Taxpayer ID Name E-mail SSN Home Phone Date of Birth Dependents 4-8 Corporation Corporate Taxpayer elements Taxpayer ID Corporate Name Employer ID Main Phone Date of Incorporation Corporate Officers Copyright © 2009. .

A BO’s Elements Must Physically Reside Somewhere In Its MO’s Tables Person (CI_PER) Individual Taxpayer Person ID 123 E-Mail Brazil_Mark@yahoo. . Mark Ids (CI_PER_ID) Type ID Number SSN 777 Phones (CI_PER_PHONE) Type Phone Number Home 973-777-7777 Work 973-451-7777 Ext 111 Characteristics (CI_PER_CHAR) 4-9 Type Value DOB 1961-11-15 Copyright © 2009. All rights reserved.com Names (CI_PER_NAME) Elements Taxpayer ID E-mail Name (Name) Name E-mail SSN (ID) Home Phone (Phone) Work Phone (Phone) Work Extension Phone Ext. (Phone) Date of Birth (Char) … Type Name Primary Brazil. Oracle.

All rights reserved. .4 Business Objects Maintenance Objects vs. Oracle. Business Objects A More Technical View Copyright © 2009.

Multi-apartment building . A BO Is Linked To A Specific MO Person MO MO Individual A tax management package may use BO's to define different types of persons Partnership Sole Proprietorship Business Object MO Corporation Premise MO Single family A utility package may use BO's to define different types of premises 4 . Oracle. All rights reserved.A MO Can have Many BO's.11 Apartment Business Object Multi-unit home – single meter Copyright © 2009.

it depends on whether we feel a BO could be used by implementations Person MO MO Base-package data Implementation data Individual Partnership These have an owner flag of C1 Business Object 4 . Sole Proprietorship Corporation .The Base Package May or May Not Have Business Objects • We'd like to stress that some base-package MO's have base-package BO's and others don't • It all depends on when the MO was created (older MO's tend not to have base-package BO's) • And.12 These have an owner flag of CM Business Object Copyright © 2009. for newer MO's. Oracle. All rights reserved.

. Oracle. by definition.Refresher: MO Metadata Defines The Physical Tables • MO meta-data defines the physical table structure of an object and the service used to talk to its instances MO Table Service MO / Table Table / Field Primary Child The fields in the MO's XML are very generic and hierarchical (to match the abstract / normalized structure of the MO’s tables) Generic and hierarchical XML..g. you won’t find Home Phone or DOB in it) An MO can have many child tables (and children can have children) Field The fields linked to the MO’s Tables are the physical fields on the database 4 . All rights reserved.13 XML Doc Copyright © 2009. does not look like how users use it (e.

Oracle. All rights reserved. Brazil • email = abc@yahoo. Brazil • email = abc@yahoo.con • ssn = 1234567 • homePhone = 973-451-7777 • birthDate = 1970-01-01 4 . Database .Technical Execution • At a high-level.14 3 Validate All business rules applied Copyright © 2009. here’s how a call to add a BO is implemented on the server 1 Add new individual taxpayer BO • taxpayerId = null • name = Mark.con • ssn = 1234567 • homePhone = 973-451-7777 • birthDate = 1970-01-01 Individual Taxpayer BO 5 2 Map Individual Taxpayer BO XML to Person MO XML Person MO Map Person XML back to Individual Taxpayer XML 4 Add 6 Individual taxpayer added • taxpayerId = 9999129912 • name = Mark.

4 Business Objects Mapping Elements To Physical Locations Copyright © 2009. Oracle. . All rights reserved.

this is because we’ve adopted an XMLlike schema definition language <taxpayerId /> <name /> <email /> <socialSecurityNumber /> <homePhone /> <birthDate /> In the demo system. .A Business Object’s Schema • A business object’s schema holds the BO’s elements IndividualTaxpayer BO Business Object Every BO has a schema that defines its elements (you can think of a schema as the BO’s "data definition area") IndividualTaxpayer Schema Notice how each element is surrounded with < … />.16 Copyright © 2009. All rights reserved. Oracle. we use "TitleCase" to define BO names and "camelCase" to define element names (you can do what you want) 4 .

This schema is invalid as its elements don’t have mapping rules… . Oracle. All rights reserved.17 Copyright © 2009.Each Element Must Define Where It’s Physically Stored • You declare where BO elements reside in the MO’s tables by declaring mapping rules MO Table MO / Table Business Object Field Table / Field IndividualTaxpayer Schema <taxpayerId /> <name /> <email /> <socialSecurityNumber /> <homePhone /> <birthDate /> 4 .

in XML parlance.18 Note. Char Type . mapField is referred to as an "attribute of the element" Person Maintenance Object (MO) Person Person Name Person Char Person Id Person Phone Id Type Phone Type Copyright © 2009. All rights reserved. Oracle.Mapping Rule Syntax 1 Mapping To Primary Table Columns • Every maintenance object has 1 and only 1 primary table • The mapping rule for an element that physically resides in a column on the MO’s primary table is simple: • mapField="COLUMN_NAME" Individual Taxpayer Schema <taxpayerId mapField="PER_ID" /> <name /> <email mapField="EMAILID" /> <socialSecurityNumber /> <homePhone /> <birthDate /> Both of these elements are easy to map because they reside on the MO’s primary table (CI_PER) 4 .

All rights reserved.You Must Map Elements To The MO's Prime Key • Every BO must have elements that map to the constituents of the MO's prime key • As you know. Char Type .19 Person Maintenance Object (MO) Person Person Name Person Char Person Id Person Phone Id Type Phone Type Copyright © 2009. the MO primary table has a "primary key" (defined in the Table / Constraint meta-data) PER_ID is the prime key of the person MO's primary table Individual Taxpayer Schema <taxpayerId mapField="PER_ID" /> <name /> <email mapField="EMAILID" /> <socialSecurityNumber /> <homePhone /> <birthDate /> 4 . Oracle.

20 Copyright © 2009. Oracle. Click here to see the documentation of the schema mapping attributes . All rights reserved.Use The "Tips" • You've just learned the first schema mapping attribute: mapField= • There are numerous other schema mapping attributes that you'll be exposed to in the upcoming slides • You will not be able to memorize these as some are sophisticated • You can find a list of all schema mapping attributes in the tips • These tips provide a list of all valid schema attributes along with many cut and paste examples 4 .

All rights reserved. Oracle. you can add / remove / update the schema as desired • This can save a great deal of time if the BO's schema is similar to the MO's data structure 4 .21 Copyright © 2009.The BO Schema Dashboard Zone • The BO Schema zone is used to populate a BO's schema with elements mapped to every field on the MO's tables • After clicking the button. Click to overwrite the BO's schemas with elements that match the MO's data structure .

. All rights reserved.22 Copyright © 2009.Team Walk Through (10 minutes) • Compare a business object to its maintenance object • Break up into teams • Your workbooks provide detailed instructions on how to work through this exercise 4 . Oracle.

4 Business Objects Flattening Elements Copyright © 2009. . Oracle. All rights reserved.

. you must identify the row's identifying column(s) and value(s) 4 .. And finally.24 Copyright © 2009. All rights reserved.Mapping A Flat Element To A Child Table • The remaining elements in our example reside in child tables linked to the person MO • The mapping syntax to flatten an element is more complicated IndividualTaxpayer Schema Person Maintenance Object (MO) <taxpayerId mapField="PER_ID"/> <name mapField="ENTITY_NAME"> <row mapChild="CI_PER_NAME"> Person Person <PRIM_NAME_SW is="true"/> Char <NAME_TYPE_FLG default="PRIM"/> </row> Person Person </name> Name Person Id Phone <email mapField="EMAILID"/> <socialSecurityNumber mapField="PER_ID_NBR"> <row mapChild="CI_PER_ID"> Phone Type Char Type Id Type <ID_TYPE_CD is="SSN"/> </row> <socialSecurityNumber/> mapField= identifies the column <homePhone mapField="PHONE" > where the element’s value resides <row mapChild="CI_PER_PHONE"> <PHONE_TYPE_CD is="HOME" /> The row node defines the child table’s name (mapChild=) </row> </homePhone> . Oracle. .

. <name mapField="ENTITY_NAME"> <row mapChild="CI_PER_NAME"> <PRIM_NAME_SW is="true" /> <NAME_TYPE_FLG default="PRIM"/> </row> </name> . Person Person Name This mapping means that 3 fields will be populated on CI_PER_NAME when this BO element is added: • ENTITY_NAME (holds the entered / supplied name) • PRIM_NAME_SW is set to Y • NAME_TYPE_FLG is set to PRIM (primary) 4 .is= versus default= • is= uniquely identifies the row that holds the element’s value • default= defines the default values of other columns on the row is= also defines the default values of the identifying columns is= means that the element mapped to the row on the CI_PER_NAME where PRIM_NAME_SW = ‘Y’ is returned Person Maintenance Object (MO) IndividualTaxpayer Schema . Person Char Person Id Person Phone Id Type Phone Type Char Type ..25 Copyright © 2009.. Oracle. All rights reserved..

. Oracle.4 Business Objects When More Than 1 Element Resides On The Same Row Copyright © 2009. All rights reserved.

All rights reserved.Mapping Multiple Elements To The Same Row • Our example has two elements that reside on the same row: workPhone and workExtension IndividualTaxpayer Schema . <workPhone mapField="PHONE" > <row mapChild="CI_PER_PHONE"> <PHONE_TYPE_CD is="WORK" /> </row> </workPhone> <workExtension mapField="EXTENSION" rowRef="workPhone" /> .27 Copyright © 2009...e. Oracle. Person Char Char Type .. on the CI_PER_PHONE row where PHONE_TYPE_CD ="WORK") rowRef= saves you from defining the mapping again (and this saves lots of time when many elements live on the same row) 4 ... Person Maintenance Object (MO) Person Person Name Person Id Person Phone Id Type Phone Type This means that workExt resides on the same row as workPhone (i.

Oracle.4 Business Objects Mapping Elements To Effective Dated Tables Copyright © 2009. All rights reserved. .

Oracle.Elements Residing In An Effective-Dated Table • Some child tables have an effective date in their prime key • This structure allows the system to maintain the value over time in case of retro-active calculations • If an element resides in an "edated" table... Person Maintenance Object (MO) Person Person Name This means the riskCategory element will have its effective date defaulted to the date when it’s first created (and this date will not change if the category is subsequently updated) 4 . All rights reserved. you don’t want different rows created when the element’s value changes) IndividualTaxpayer Schema . <riskCategory mapField="ADHOC_CHAR_VAL" > <row mapChild="CI_PER_CHAR"> <CHAR_TYPE_CD is="RISKCAT" /> <EFFDT default="%CurrentDate" /> </row> </riskCategory> ..29 Copyright © 2009. you must decide if you care about changes over time • If you don’t care (i..e. Person Char Person Id Person Phone Id Type Phone Type Char Type ..

.. the value effective on the current date is retrieved) Person Maintenance Object (MO) Person Person Name Notice that mapField= references the column that holds the effective date. All rights reserved.If Effective Date Matters • If you do care (i.. <riskCategory mapField="ADHOC_CHAR_VAL" > <row mapChild="CI_PER_CHAR"> <CHAR_TYPE_CD is="RISKCAT" /> <EFFDT is="%effectiveDate(riskEdate)" /> </row> </riskCategory> <riskEdate mapField="EFFDT" rowRef="riskCategory"/> . Notice that default= is not used.30 Copyright © 2009. Person Char Person Id Person Phone Id Type Phone Type Char Type . rather is= is used (with a reference to the element that holds the effective date) IndividualTaxpayer Schema . Oracle..e.. the value effective on the that date is retrieved (otherwise. you want all changes to be recorded as separate rows in the table) If this BO is read and riskEdate is populated. also notice the rowRef= references the effective-dated element 4 .

4 Business Objects Mapping Elements To Language Tables Copyright © 2009. Oracle. . All rights reserved.

you don't have to flatten it IndividualTaxpayer Schema . Oracle.You Don't Have To Flatten Attributes On Language Tables • If an element resides on the primary table's "language table". All rights reserved.32 Copyright © 2009. <phoneType mapField="PHONE_TYPE_CD"/> <phoneFormat mapField="PHONE_FMT_ALG_CD"/> <version mapField="VERSION"/> <description mapField="DESCR"/> Phone Type Object (MO) The DESCR column is not on the primary table. but it doesn't require a flattening syntax as the framework knows to look on the primary table's language table if it can't find the field on the MO's primary table 4 .. Phone Type Language Language ..

4 Business Objects Validation and Defaulting Copyright © 2009. . All rights reserved. Oracle.

Oracle. Person Char Person Id Person Phone Id Type Phone Type Char Type .. <birthDate mapField="ADHOC_CHAR_VAL" dataType="date"> <row mapChild="CI_PER_CHAR"> <CHAR_TYPE_CD is="BIRTHDT" /> <EFFDT default="%CurrentDate" /> </row> </birthDate> .dataType= • If you want the system to validate that an element’s value holds a specific type of data... use dataType= • Use the "tips" to see all of the valid dataTypes • Note: dataType="lookup" / lookup=… can be used to define valid values for an element in a lookup value IndividualTaxpayer Schema . 4 . All rights reserved.34 This means the system will validate that birthDate is in system format (YYYY-MM-DD) before a person is added or updated Person Maintenance Object (MO) Person Person Name Copyright © 2009..

no exceptions (otherwise the system won't be translatable or multi-lingual) 4 ... <birthDate mapField="ADHOC_CHAR_VAL" dataType="date"> <row mapChild="CI_PER_CHAR"> <CHAR_TYPE_CD is="BIRTHDT" /> <EFFDT default="%CurrentDate" /> </row> </birthDate> . . every element that doesn't map to a "true column" must have an mdField= attribute. Copyright © 2009. but you discover later in this course that this allows for a multi-lingual and translatable application For base-package development.. <birthDate mapField="ADHOC_CHAR_VAL" mdField="BIRTH_DT"> ..the bottom means that you’ve created a meta-data field with a type of "date" and a label of "Birth Date". you can use mdField= and reference the meta-data field whose format controls how the field’s value is validated Both do the same thing .... IndividualTaxpayer Schema .dataType= vs mdField= • Rather than use dataType=. All rights reserved.. this is more work up front..35 IndividualTaxpayer Schema . Oracle. </birthDate> ..

. Person MO Person Name While the MO logic will validate this char value is a FK (as per the char type). <primaryContract mapField="CHAR_VAL_FK1" fkRef="SA" > <row mapChild="CI_PER_CHAR"> <CHAR_TYPE_CD is="PRIMCON" /> <EFFDT default="%CurrentDate" /> </row> </propertyManager> . All rights reserved..fkRef= • If you want the system to validate that an element’s value holds a foreign key. use fkRef= • The attributes value must reference a "FK reference code" (a FK reference is meta-data that describes a foreign key) IndividualTaxpayer Schema . Oracle... Person Person Char Person Id Person Phone Id Type Phone Type Char Type . The above technique means you'll get a good message 4 . the error message will be "nasty" (it'll reference the char type).36 Copyright © 2009.

don't use dataType= 4 . same goes for physical fields that are foreign keys. • Good rules of thumb are: • If you've used mdField= on an element. you can't put a number into it. etc. Oracle.dataType= Cannot Contradict Physical Field Rules • You cannot contradict the physical field's actual data type (except for physical fields that are defined as strings) • For example. if a physical field is defined as being a date. lookups. All rights reserved..g. START_DT) using mapField=. don't use dataType= • If you've mapped an element to a non-generic column (e.37 Copyright © 2009. .

Oracle..38 Copyright © 2009. <birthDate mapField="ADHOC_CHAR_VAL" dataType="date" required="true" > <row mapChild="CI_PER_CHAR"> <CHAR_TYPE_CD is="BIRTHDT" /> <EFFDT default="%CurrentDate" /> </row> </birthDate> . All rights reserved. Person Char Person Id Person Phone Id Type Phone Type Char Type .required="true" • If you want the system to validate that an element is present and non-blank.... use required="true" IndividualTaxpayer Schema . This means the system will make sure that birthDate is supplied (and a valid date) Person Maintenance Object (MO) Person Person Name 4 .

they could "blank it out" on an update) Copyright © 2009...e. Oracle. This will default the value of mngGroup on an add (to ALL).39 ResidentialAccount Schema . <customerType mapField="CUST_CLASS_CD" required="true" default="R" /> <mngGroup mapField="ACCT_MGMT_GRP_CD" default="ALL" /> . .Defaulting • On the earlier flattening slides.e. All rights reserved. you saw how you can default the values of related columns on a flattened element's row using is= and default= This will default the value of customerType on an add and update (i.. but not on an update (i.... <birthDate mapField="ADHOC_CHAR_VAL" dataType="date" > <row mapChild="CI_PER_CHAR"> <CHAR_TYPE_CD is="BIRTHDT" /> <EFFDT default="%CurrentDate" /> </row> </birthDate> ..... This mapping means that 2 fields on the flattened row will be defaulted: • CHAR_TYPE_CD is set to BIRTHDT • EFFDT is set to current date 4 . it can't be blanked out) IndividualTaxpayer Schema .

.40 Copyright © 2009.Defaulting System Variables • You've seen one system variable being defaulted so far (%CurrentDate) • There are other variables (check them out in the tips) 4 . Oracle. All rights reserved.

All rights reserved. Oracle.4 Business Objects Other Types of Elements Copyright © 2009. .

42 Copyright © 2009. . 4 .. also notice IndividualTaxpayer Schema how this element is not mapped . Oracle... <homeAddress type="group"> <country mapField="COUNTRY" default="USA"/> <address1 mapField="ADDRESS1"/> Besides elegance..e.Groups of Elements • The elements encountered up to now are classic "fields" and don’t require you to declare their type (type=field is the default) • You can declare other types of elements. you can do a "move by <homeAddress /> name" from one group to another) . we’ll first describe type=group Groups allow you to document groups of other elements Notice the type= attribute. All rights reserved.. the other reason (that <address2 mapField="ADDRESS2"/> you’ll discover later) is that you can move <city mapField="CITY"/> a group to a similar group in a single <postal mapField="POSTAL"/> <state mapField="STATE"/> statement (i.

Lists = Array • You can also declare arrays of elements (and arrays within arrays) using type=list An element where type=List declares the structure of an array (this example is for an array of seasonal addresses) IndividualTaxpayer Schema . Oracle.. ... 4 . <seasonalAddress type="list" mapChild="CI_PER_ADDR_SEAS"> <country mapField="COUNTRY" default="USA"/> <address1 mapField="ADDRESS1"/> <address2 mapField="ADDERSS2"/> <city mapField="CITY"/> <postal mapField="POSTAL"/> <state mapField="STATE"/> <seasonStart mapfield="SEASON_START_MMDD"/> <seasonEnd mapfield="SEASON_END_MMDD"/> <sequence mapfield="SEQ_NUM"/> <seasonalAddress /> . All rights reserved.43 Notice the mapChild= attribute (it defines the table that the array lives on) Copyright © 2009..

All rights reserved. Oracle.4 Business Objects Naming Conventions Copyright © 2009. .

. if multiple words are used. use title case • For example: • F1-Country • C1-CustomerContact • A2-Message121 4 .BO Naming Convention • All base-package BO's have a code in the format XX-Yyyy where: • XX is the owner flag • Yyyy is the BO's description.45 Copyright © 2009. Oracle. All rights reserved.

no exceptions • Without this. • Words like 'code'. Oracle. we don't have a translatable label for this field and this is a requirement for base-package deliverables 4 . .abbreviations in the common TUGBU parlance are allowed. etc. but it bears repeating . Id. 'switch'.Element Naming Convention • All base-package elements will use camelCase.every element that can appear on a UI must have some type of mapping to a metadata field (either via mapField= or mdField=).46 Copyright © 2009. are generally not appropriate as suffixes for an element name • The following is not a naming convention. All rights reserved. like bo. or 'flag'. for example: • • • • customerName postalCode accountId saId • Abbreviations are not used because developers always have different abbreviation standards and avoiding them makes it easier to avoid inconsistencies between schemas • One exception .

.. Copyright © 2009. Oracle.. All rights reserved. <OutboundMsgStatFlg mapField="OUTMSG_STATUS_FLG"/> <CreationDttm dataType="dateTime" mapField="CRE_DTTM"/> <EmailDocument type="group" mapXML="XML_SOURCE"> <From type="group"> <InternetAddress type="group"> <address mdField="EMAILID"/> <personal dataType="string"/> <charset dataType="string"/> </InternetAddress> </From> <To type="list"> <InternetAddress type="group"> <address mdField="EMAILID" isPrimeKey="true"/> <personal dataType="string"/> <charset dataType="string"/> </InternetAddress> </To> <Subject type="group"> <text dataType="string"/> <charset dataType="string"/> </Subject> .Team Walk Through (15 minutes) • Break up into teams and prepare a list of what's wrong and what's right about this schema? 4 .47 F1-emailMsg Schema .. .

.4 Business Objects Concurrency Checks When BO’s Are Updated Copyright © 2009. Oracle. All rights reserved.

49 Copyright © 2009. Oracle. All rights reserved. Concurrency Checking Will Take Place • If a BO is changed and the system sees it has an element mapped to VERSION. Person Char Person Id Person Phone Id Type Phone Type Char Type .If An Element Is Mapped To Version. no concurrency validation will take place when the BO is updated (and you might want this) 4 . it will abort the change if the MO’s VERSION is not identical to the BO’s version (the MO’s version is changed when it’s updated) IndividualTaxpayer Schema <taxpayerId mapField="PER_ID"/> <name mapField="ENTITY_NAME"> <row mapChild="CI_PER_NAME"> <PRIM_NAME_SW is="true"/> <NAME_TYPE_FLG default="Primary"/> </row> </name> <email mapField="EMAILID"/> <version mapField="VERSION" /> Person Maintenance Object (MO) Person Person Name If you don’t include this.

Oracle.4 Business Objects Populating Base Package Fields That You Don’t Want Anyone To Know About Copyright © 2009. . All rights reserved.

Oracle... this element will never appear in the XML representation of the business object 4 .Populating and Hiding MO Fields • Mark an element as private="true" if you don’t want the element exposed to invokers of the BO IndividualTaxpayer Schema Person Maintenance Object (MO) <taxpayerId mapField="PER_ID"/> <name mapField="ENTITY_NAME"> <row mapChild="CI_PER_NAME"> <PRIM_NAME_SW is="true"/> <NAME_TYPE_FLG default="PRIM"/> </row> </name> <email mapField="EMAILID"/> . Person Char Person Id Person Phone Id Type Phone Type Char Type .. Person Person Name When an IndividualTaxpayer is added.51 Copyright © 2009.. All rights reserved. its PER_OR_BUS_FLG column will be populated with P (person) and because private="true". <perBusFlag mapfield="PER_OR_BUS_FLG" default="P" private="true" /> .

Oracle. . All rights reserved.4 Business Objects Mapping Elements To Character Large Object (CLOB) Columns Copyright © 2009.

it means that this table contains a CLOB Copyright © 2009.53 Remember. .Refresher: XML Extensions • A subset of tables have a column that holds an XML document (this column is referred to as a CLOB) • Business objects can be configured to store elements in this XML document (rather than in individual columns) • The next sections describe how this is done Person CLOB 4 . Oracle. when you see this on an ERD. All rights reserved.

54 Copyright © 2009. All rights reserved. very large column on a table that is part of a maintenance object • A trend going forward is to allow business objects to have elements that are stored in the MO's CLOB • For example. in turn. . Oracle. the vast majority of the field values are stored in the CLOB (in an XML document) • You'll find that CLOBs support all of the element structures that you've learned up to now • This means that if the physical tables don't have a place to store your elements. • Market message and tax form objects have a CLOB on their primary table • This CLOB contains an XML document which. contains the message / form’s data • Whenever a message / form is created. you can put them in a CLOB – But you can only do this for MO's that have CLOBs 4 .Access to Fields Stored in a Character Large Object (CLOB) • A CLOB is very.

55 Copyright © 2009. All rights reserved.. <messageTypeCode mapXML="BO_DEFN_AREA" /> <versionNumber mapXML="BO_DEFN_AREA" /> <marketTimeStamp mapXML="BO_DEFN_AREA" /> <senderID mapXML="BO_DEFN_AREA" /> <recipientID mapXML="BO_DEFN_AREA" /> <txRefNbr mapXML="BO_DEFN_AREA" /> . Inbound Message CLOB These elements are stored in a CLOB column called BO_DEFN_AREA that resides on the inbound message table 4 . ....Mapping Fields Residing in a CLOB • The mapping syntax is very simple for elements held in a CLOB: • Use the mapXML="x" to map an element into a CLOB (where x is the name of the CLOB's column) A Snippet Of A Market Message Schema . Oracle.

All rights reserved. <messageTypeCode mapXML="BO_DEFN_AREA" /> <versionNumber mapXML="BO_DEFN_AREA" /> <marketTimeStamp mapXML="BO_DEFN_AREA" /> <senderID mapXML="BO_DEFN_AREA" /> <recipientID mapXML="BO_DEFN_AREA" /> <txRefNbr mapXML="BO_DEFN_AREA" /> .If You Were To Look At The Contents Of The CLOB • You’d see XML A Snippet Of A Market Message Schema The BO’s schema .... 4 .. Oracle. ..56 How a given message’s CLOB looks (this is just simple xml) Copyright © 2009. Inbound Message CLOB <messageTypeCode>AA-101</messageTypeCode> <versionNumber>123</versionNumber> ..

. Oracle. don't specify these attributes A Snippet Of A Market Message Schema .XML Elements Can Be Validated Just Like Other Elements • If an element held as XML is anything other than a string.57 Copyright © 2009. All rights reserved. 4 .. <messageType mapXML="BO_DEFN_AREA" mdField="MSG_TYPE_CD" required="true" /> <versionNumber mapXML="BO_DEFN_AREA" /> <marketTimeStamp mapXML="BO_DEFN_AREA" /> Notice how we properly used mdField= <senderID mapXML="BO_DEFN_AREA" /> rather than dataType= <recipientID mapXML="BO_DEFN_AREA" /> <taxReferenceNumber mapXML="BO_DEFN_AREA" /> <receiveDate mapXML="BO_DEFN_AREA" mdField="RCV_DT" /> . you should declare either an mdField= attribute or a dataType= attribute (remember. you MUST use mdField= in order to have the system produce a translatable label) • If an element is mandatory. if the element can appear on a UI... if you don't want this validation to take place. . declare required="true" • This works the same way as described earlier • So.

. All rights reserved.CLOB vs Characteristics • The rule . you need to put it into a characteristic rather than the CLOB (can't have indexes for elements in CLOB's (at least not today)) 4 . Copyright © 2009. <messageType mapXML="BO_DEFN_AREA" /> <versionNumber mapXML="BO_DEFN_AREA" /> <marketTimeStamp mapXML="BO_DEFN_AREA" /> <senderId mapXML="BO_DEFN_AREA" /> <recipientId mapXML="BO_DEFN_AREA" /> <taxReferenceNumber mapXML="BO_DEFN_AREA" /> <receiveDate mapXML="BO_DEFN_AREA" dataType="date" /> <serviceAgreementId mapField="FK_CHAR_VAL" > <row mapChild="CI_CASE_CHAR"> <CHAR_TYPE_CD is="SA ID" /> </row> </serviceAgreementId> .if you need to "join" to an element value. Oracle. it needs to reside in a real column A Snippit Of A Market Message Schema Inbound Message CLOB Char Type Charact.. Because we will likely have an SQL join to a case’s SA ID.. .58 ..

Oracle. All rights reserved. .4 Business Objects Other Element Types Can Be Held In A CLOB Copyright © 2009.

you'll learn later that you can move a group to a similar group in a single statement Copyright © 2009.. . All rights reserved. Oracle.Groups of Elements • Groups and lists can be held in a CLOB • We'll first show a type="group": A Snippet Of A Market Message Schema . <messageHeader type="group" mapXML="BO_DEFN_AREA" > <messageTypeCode required="true" /> <versionNumber required="true" /> <marketTimeStamp required="true" /> <senderID required="true" /> <recipientID required="true" /> <txRefNbr required="true" /> </messageHeader> 4 .. you had to declare a mapField on each member of the group) Besides elegance.60 Groups allow you to nicely document groups of other elements Notice that you only have to define the mapXML= once for the group (if you recall the earlier discussion of groups.

. All rights reserved.If You Were To Look At The Contents Of The CLOB • You’d see XML A Snippet Of A Market Message Schema The BO’s schema . <messageHeader> <messageTypeCode>ASDF</messageTypeCode> <versionNumber>123</versionNumber> ...61 Copyright © 2009... <messageHeader type="group" mapXML="BO_DEFN_AREA"> <messageTypeCode mdField="MSG_TYPE_CD"/> <versionNumber /> <marketTimeStamp dataType="dateTime"/> <senderID /> <recipientID /> <txRefNbr /> </messageHeader> . </messageHeader> 4 .. Inbound Message CLOB Notice the group node . Oracle.

Multiple Groups In The Same CLOB • You can keep an unlimited number of groups in the CLOB A Snippet Of A Market Message Schema . <messageHeader type="group" mapXML="BO_DEFN_AREA"> <messageTypeCode required="true" /> <versionNumber required="true" /> <marketTimeStamp required="true" /> <senderID required="true" /> <recipientID required="true" /> <txRefNbr required="true" /> </messageHeader> <BGTReference type="group" mapXML="BO_DEFN_AREA"> <bgtSystemRefNumber required="true" /> <shipperRefNumber required="true" /> <gprn required="true" /> <shipperId required="true" /> <supplierId required="true" /> </BGTReference> Inbound Message CLOB Notice how both groups of elements are mapped to the same CLOB ....62 Copyright © 2009. . 4 . Oracle.. All rights reserved.

All rights reserved. Copyright © 2009. 4 .. Oracle..Lists = Array • You can also declare arrays of elements (and arrays within arrays) using type="list" An element where type="list" IndividualTaxpayer Schema .. <seasonalAddress type="list" <country default="USA"/> <address1 /> <address2 /> <city /> <postal /> <state /> <seasonStart /> <seasonEnd /> <sequence /> <seasonalAddress /> . .63 declares the structure of an array (this example is for an array of seasonal addresses) mapXML="BO_DEFN_AREA"> Notice the mapXML= attribute (it is only declared on the list) Why is this example bad? Because the likelihood that these fields will appear on a UI is very high and there are no mdField= attributes on each element..

you will find them on more MO's 4 . the number is limited (due to time constraints) • In future releases.CLOB's Aren't Everywhere • Most post 2. All rights reserved. Oracle. however.64 Copyright © 2009. .2 MO's support CLOBs • There are some older MO's that support CLOBs.

65 Copyright © 2009.Team Walk Through (15 minutes) • Examine a BO that uses a CLOB • Break up into teams • Your workbooks provide detailed instructions on how to work through this exercise 4 . Oracle. All rights reserved. .

Oracle. . All rights reserved.4 Business Objects Raw Data Types Copyright © 2009.

67 Copyright © 2009. .Foreshadowing • You can create elements that reside in a CLOB using type="raw" • These elements are created when you need to save XML documents within an XML document • For example. we frequently need to save the message that was sent into the system in the exact format in which it was received • To do this. in a market message world. Oracle. All rights reserved. you can create a raw element called something like originalMessage and define it as type="raw" • There are other more interesting examples of raw elements that will be described much later in the class 4 .

All rights reserved.4 Business Objects Standalone Data Areas Allow Reuse Copyright © 2009. Oracle. .

all using schemas are "changed" 4 .07" /> <includeDA name="StandardTaxpayerElements"/> <1040ezpage1 type="group" mapXML="BO_DEFN_AREA"> <line1 dataType="number"/> <line2 dataType="number"/> <1040ezpage1/> Copyright © 2009.07" /> <includeDA name="StandardTaxpayerElements"/> <1040page1 type="group" mapXML="BO_DEFN_AREA"> <line1 dataType="number"/> <line2 dataType="number"/> <1040page1/> Form1040ez BO Schema <formType mapField="CASE_TYPE_CD" default="1040ez. this is a real-time include and therefore when the standalone schema is changed. All rights reserved. Oracle.69 <formType mapField="CASE_TYPE_CD" default="1040a... . </standardTaxpayerElements> This standalone data area can be included in other schemas Note. you can set up a "stand alone data area" schema and then include it in each BO Form1040a BO Schema StandardTaxpayerElements Standalone Schema <standardTaxpayerElements type="group" mapXML="BO_DEFN_AREA"> <ssn /> <lastName /> <firstName /> <address1 /> <address2 /> .Data Area Schema • If you have multiple BO’s that share a common structure.

Schema Business Rules • Recall that simple business rules can be defined in a schema Form1040a BO Schema StandardTaxpayerElements Standalone Schema <standardTaxpayerElements type="group" mapXML="BO_DEFN_AREA"> <ssn required="true" /> <lastName required="true" /> <firstName /> <address1 /> <address2 /> .07" /> <includeDA name="StandardTaxpayerElements"/> <1040page1 type="group" mapXML="BO_DEFN_AREA"> <line1 dataType="number"/> <line2 dataType="number"/> <1040page1/> Form1040ez BO Schema <formType mapField="CASE_TYPE_CD" default="1040ez. All rights reserved.. Oracle. </standardTaxpayerElements> Any business rule defined in the schema applies to any BO that includes it <formType mapField="CASE_TYPE_CD" default="1040a. ..70 Copyright © 2009.07" /> <includeDA name="StandardTaxpayerElements"/> <1040ezpage1 type="group" mapXML="BO_DEFN_AREA"> <line1 dataType="number"/> <line2 dataType="number"/> <1040ezpage1/> 4 .

you might have 50 different types of field activities and all might have a common structure to identify where and when the activity should take place • It would be wise to declare the elements that are the same on all fields activities in a stand-alone data area and then include this in the 50 field activity BO's 4 . All rights reserved.Mapping To Fields That Aren't In CLOBs • Please be aware that a stand-alone data area can hold elements that are mapped to true columns • For example. .71 Copyright © 2009. Oracle.

Data Area Schema
• Foreshadowing – in future chapters, you'll learn about
business services and service scripts
• Both of these objects have their data defined in a schema
• It's strongly recommended that you take advantage of stand-alone
data areas to avoid redundant data definitions

• Also note, a stand-alone data area schema can reference
other stand-alone schemas (if you're really keen on
avoiding redundancy)

4 - 72

Copyright © 2009, Oracle. All rights reserved.

4

Business Objects

Performance

Copyright © 2009, Oracle. All rights reserved.

If You Have Large BO's…
• Let's assume you have BO's with many elements from
many tables
• If you find that you need a small subset of the fields in the
majority of your data access and update requests, you
should consider creating a "scaled down" version of the
BO that only has the subset of fields
• This helps performance because the system only
performs the IO to retrieve the elements on the specified
BO (not on its underlying MO)

4 - 74

Copyright © 2009, Oracle. All rights reserved.

4

Business Objects

XAI

Copyright © 2009, Oracle. All rights reserved.

change and delete BO's • Just use the context menu entry on the BO 4 .76 Copyright © 2009. add. .Exposing BO's To The World • It's very easy to create an XAI service so that the outside world can read. All rights reserved. Oracle.

All rights reserved.4 Business Objects Summary Copyright © 2009. . Oracle.

. easy way to validate subclasses. easy way to retrieve and update data in our highly normalized databases) • More benefits will be unveiled in future chapters 4 . there are no database changes required or new Java classes to author • The benefits are beginning to be unveiled (e. Oracle. All rights reserved.g.MO's and BO's • At this point you know that MO's are physical representations of the system's objects • You also know that you can declare an unlimited number of BO's for each MO (where each BO defines a logical type of the MO) • And this can be done using meta-data.78 Copyright © 2009..

Oracle. .Team Walk Through (30 minutes) • Compare a BO with the blueprint design • 4 .79 Break up into teams and follow the instructions in the workbook Copyright © 2009. All rights reserved.

All rights reserved.Review Questions 4 . . Oracle.80 Copyright © 2009.

Oracle.4 .81 Copyright © 2009. . All rights reserved.