The XML grammar

The XML grammar is an open definition containing the attribute = value pairs of a business object. The XML grammar supports the concept of embedded business objects and business object containers. All value-types are converted and reconstructed from their String representations.

This adapter uses an XML format for sending business objects into and out of the integration broker. This format is defined generically to support any new business objects created inside the integration broker through the business object designer. This section describes what that format is (DTD) and how the XML instance reflects the integration broker business object. Understanding this format enables you to add new objects for your adapter to support as well as modify existing business objects.

An object definition begins with a BusinessObject tag. The attributes for this tag are as follows:

BusinessObject

class
The business object type of the object.
type
The cardinality of the object; the value is always SINGLECARDSTRING.
verb
The verb associated with this object. This attribute is necessary only in the initial document tag.

The contents of each BusinessObject element are Attributes. The attributes are as follows:

Attribute

class
The class of the business object. Used only when the Attribute value is a business object and thus refers to the class of that object as in a BusinessObject tag.
name
The attribute name within the object definition.
type
The type of the attribute value. The value of this attribute can be any of business object simple types (for example. String or Date). In this case, the content of the tag is the String representation of the attribute value.

To define a business object as the attribute, the value of type is SINGLECARDSTRING (for single cardinality objects) or MULTIPLECARDSTRING (for n-cardinality objects). In this case, the content of the tag is a BusinessObject element (or multiple elements in the case of n-cardinality). With this grammar, arbitrary depth business objects can be expressed.

The schema is included in the following example for reference with a sample object definition:

<?xml version="1.0" encoding="UTF-8"?>
   <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <xsd:element name="BusinessObject">
           <xsd:annotation>
               <xsd:documentation> Grammar definition for WBI Business 				Objects 
   </xsd:documentation>
           </xsd:annotation>
           <xsd:complexType>
               <xsd:sequence>
                   <xsd:element maxOccurs="unbounded" minOccurs="1" ref="Attribute"/>
               </xsd:sequence>
               <xsd:attribute name="type" type="xsd:string" use="required"/>
               <xsd:attribute name="verb" type="xsd:string" use="required"/>
               <xsd:attribute name="class" type="xsd:string" use="required"/>
           </xsd:complexType>
       </xsd:element>
       <xsd:element name="Attribute">
           <xsd:complexType mixed="true">
               <xsd:choice maxOccurs="unbounded" minOccurs="0">
                   <xsd:element ref="BusinessObject"/>
               </xsd:choice>
               <xsd:attribute name="name" type="xsd:string" use="required"/>
               <xsd:attribute name="type" type="xsd:string" use="required"/>
           </xsd:complexType>
       </xsd:element>
   </xsd:schema>
    
    
    
   

The following is a simple example.

<?xml version="1.0" encoding="UTF-8"?>
   <BusinessObject class="EMail" type="SINGLECARDSTRING" verb="Create">
   	<Attribute class="Header" name="Header" type="SINGLECARDSTRING">
   		<BusinessObject class="Header" type="SINGLECARDSTRING">
   			<Attribute name="sendDate" type="Date">2003-1-18</Attribute>
   			<Attribute name="subject" type="String">Greetings</Attribute>
   			<Attribute class="Name" name="Recipients" type="MULTIPLECARDSTRING">
   				<BusinessObject class="Name" type="SINGLECARDSTRING">
   					<Attribute name="FirstName" type="String">John</Attribute>
   					<Attribute name="LastName" type="String">Doe</Attribute>
   				</BusinessObject>
   				<BusinessObject class="Name" type="SINGLECARDSTRING">
   					<Attribute name="FirstName" type="String">Jane</Attribute>
   					<Attribute name="LastName" type="String">Doe</Attribute>
   				</BusinessObject>
   			</Attribute>
   		</BusinessObject>
   	</Attribute>
   	<Attribute name="body" type="String">Hello All</Attribute>
   </BusinessObject>
    
   

Copyright IBM Corp. 1997, 2003