Professional Documents
Culture Documents
05 - BO Elements
05 - BO Elements
They are true subclasses of the MO and therefore take advantage of the rich,
safe, and sophisticated business rules embodied in the base-package MOs
DOB 1961-11-15
Sole Proprietorship
Business
Object Corporation
Form MO
MO
Income Tax
Partnership
These have an
owner flag of C1 Sole Proprietorship
Business
Business
Object Corporation
Object
<taxpayerId />
<name />
<email />
<socialSecurityNumber />
Notice how each element is <homePhone />
surrounded with < />; this is <birthDate />
because weve adopted an XML-
like schema definition language
MO Table Field
MO / Table Table / Field
Business
Object IndividualTaxpayer Schema
<taxpayerId />
<name />
<email />
<socialSecurityNumber />
<homePhone /> This schema is invalid
<birthDate />
as its elements dont
have mapping rules
Both of these elements are easy to Id Type Phone Type Char Type
map because they reside on the
MOs primary table (CI_PER)
Flattening Elements
is= uniquely identifies the row that holds the elements value
default= defines the default values of other columns on the row
is= also defines the default values is= means that the element mapped to the row on the
of the identifying columns CI_PER_NAME where PRIM_NAME_SW = Y is returned
...
<name mapField="ENTITY_NAME"> Person
Person
<row mapChild="CI_PER_NAME"> Char
<PRIM_NAME_SW is="true" />
<NAME_TYPE_FLG default="PRIM"/> Person
Name Person
</row> Person Id
Phone
</name>
...
Id Type Phone Type Char Type
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)
Our example has two elements that reside on the same row:
workPhone and workExtension
rowRef= saves you from defining the mapping again (and this
saves lots of time when many elements live on the same row)
Notice that mapField= references the column that holds the effective
date; also notice the rowRef= references the effective-dated element
Rather than use dataType=, you can use mdField= and reference the
meta-data field whose format controls how the fields value is
validated
IndividualTaxpayer Schema
...
<birthDate mapField="ADHOC_CHAR_VAL"
Both do the same thing - the bottom dataType="date">
means that youve created a meta- <row mapChild="CI_PER_CHAR">
data field with a type of "date" and a <CHAR_TYPE_CD is="BIRTHDT" />
<EFFDT default="%CurrentDate" />
label of "Birth Date"; this is more work </row>
up front, but you discover later in this </birthDate>
course that this allows for a multi- ...
lingual and translatable application IndividualTaxpayer Schema
...
<birthDate mapField="ADHOC_CHAR_VAL"
For base-package development, every element mdField="BIRTH_DT">
...
that doesn't map to a "true column" must have an </birthDate>
mdField= attribute, no exceptions (otherwise the ...
system won't be translatable or multi-lingual)
IndividualTaxpayer Schema
...
<primaryContract mapField="CHAR_VAL_FK1" fkRef="SA" >
<row mapChild="CI_PER_CHAR">
<CHAR_TYPE_CD is="PRIMCON" /> Person MO
<EFFDT default="%CurrentDate" />
</row>
</primaryContract>
... Person
Person
Person
Name Char
If you want the system to validate that an element is present and non-
blank, use required="true"
Person
Name Person
Person Id
Phone
IndividualTaxpayer Schema
...
ResidentialAccount Schema
<birthDate mapField="ADHOC_CHAR_VAL"
...
dataType="date" >
<customerType mapField="CUST_CLASS_CD"
<row mapChild="CI_PER_CHAR">
required="true" default="R" />
<CHAR_TYPE_CD is="BIRTHDT" />
<mngGroup mapField="ACCT_MGMT_GRP_CD"
<EFFDT default="%CurrentDate" />
default="ALL" />
</row>
...
</birthDate>
...
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
...
<seasonalAddress type="list" Notice the mapChild= attribute (it
mapChild="CI_PER_ADDR_SEAS">
<country mapField="COUNTRY" default="USA"/> defines the table that the array lives on)
<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 />
...
Naming Conventions
<taxpayerId mapField="PER_ID"/>
<name mapField="ENTITY_NAME"> Person Maintenance Object (MO)
<row mapChild="CI_PER_NAME">
<PRIM_NAME_SW is="true"/>
<NAME_TYPE_FLG default="Primary"/>
</row> Person
Person
</name> Char
<email mapField="EMAILID"/>
Person
<version mapField="VERSION" /> Name Person
Person Id
Phone
IndividualTaxpayer Schema
Person Maintenance Object (MO)
<taxpayerId mapField="PER_ID"/>
<name mapField="ENTITY_NAME">
<row mapChild="CI_PER_NAME">
<PRIM_NAME_SW is="true"/> Person
Person
<NAME_TYPE_FLG default="PRIM"/> Char
</row>
Person
</name> Person
Name Person Id
<email mapField="EMAILID"/> Phone
...
<perBusFlag mapfield="PER_OR_BUS_FLG"
default="P" private="true" /> Id Type Phone Type Char Type
...
Mapping Elements To
Character Large Object (CLOB) Columns
Person
Remember, when you see this on an ERD,
CLOB it means that this table contains a CLOB
...
<messageTypeCode mapXML="BO_DEFN_AREA" />
<versionNumber mapXML="BO_DEFN_AREA" /> Inbound
<marketTimeStamp mapXML="BO_DEFN_AREA" /> Message
<senderID mapXML="BO_DEFN_AREA" />
CLOB
<recipientID mapXML="BO_DEFN_AREA" />
<txRefNbr mapXML="BO_DEFN_AREA" />
...
These elements are stored in a CLOB
column called BO_DEFN_AREA that
resides on the CI_CASE table
...
<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" /> Inbound
<txRefNbr mapXML="BO_DEFN_AREA" />
... Message
CLOB
<messageTypeCode>AA-101</messageTypeCode>
<versionNumber>123</versionNumber>
... How a given messages CLOB
looks (this is just simple xml)
...
<messageType mapXML="BO_DEFN_AREA" mdField="MSG_TYPE_CD" required="true" />
<versionNumber mapXML="BO_DEFN_AREA" />
<marketTimeStamp mapXML="BO_DEFN_AREA" />
<senderID mapXML="BO_DEFN_AREA" />
Notice how we properly used mdField=
<recipientID mapXML="BO_DEFN_AREA" /> rather than dataType=
<taxReferenceNumber mapXML="BO_DEFN_AREA" />
<receiveDate mapXML="BO_DEFN_AREA" mdField="RCV_DT" />
...
...
<messageType mapXML="BO_DEFN_AREA" />
Inbound <versionNumber mapXML="BO_DEFN_AREA" />
Message <marketTimeStamp mapXML="BO_DEFN_AREA" />
CLOB
<senderId mapXML="BO_DEFN_AREA" />
<recipientId mapXML="BO_DEFN_AREA" />
<taxReferenceNumber mapXML="BO_DEFN_AREA" />
<receiveDate mapXML="BO_DEFN_AREA" dataType="date" />
<messageHeader>
<messageTypeCode>ASDF</messageTypeCode>
<versionNumber>123</versionNumber> Notice the group node
...
</messageHeader>
...
<messageHeader type="group" mapXML="BO_DEFN_AREA">
<messageTypeCode required="true" /> Inbound
<versionNumber required="true" />
<marketTimeStamp required="true" /> Message
<senderID required="true" /> CLOB
<recipientID required="true" />
<txRefNbr required="true" />
</messageHeader>
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
IndividualTaxpayer Schema array of seasonal addresses)
...
<seasonalAddress type="list" mapXML="BO_DEFN_AREA">
<country default="USA"/>
<address1 />
<address2 />
<city />
<postal /> Notice the mapXML= attribute (it
<state /> is only declared on the list)
<seasonStart />
<seasonEnd /> Why is this example bad? Because the
<sequence />
<seasonalAddress /> likelihood that these fields will appear on a
... UI is very high and there are no mdField=
attributes on each element.
<formType mapField="CASE_TYPE_CD"
StandardTaxpayerElements Standalone Schema default="1040a.07" />
Form1040a BO Schema
<formType mapField="CASE_TYPE_CD"
StandardTaxpayerElements Standalone Schema default="1040a.07" />
Performance
XAI
Summary