Creating business object definitions

An XML document can have either a DTD or a schema document to define its structure. The business object definitions that represent the elements in an XML document must contain information about the document's structure. To create business objects to be processed by the XML data handler, the XML data handler must be able to locate business object definitions that contain the structural information for each XML document to be processed. You can generate business object definitions for XML documents in one of the following ways:

Both these techniques involve use of the Business Object Designer tool. This section provides an overview on how to use Business Object Designer to generate business object definitions for XML documents. For a complete description of Business Object Designer , refer to the Business Object Development Guide.

Note:
Some connectors that use the XML data handler require a top-level wrapper business object that contains the content business objects as children. Depending on the business object structure required by the connector you are using, therefore, you may need to add generated business objects as children to another business object. See the documentation for each connector for information on the structure of its business objects.

Using an XML ODA to create business object definitions

The XML Object Discovery Agent (ODA) creates business object definitions for an XML document based on either its DTD or schema document. The ODA examines the DTD or schema document to obtain information about the XML document structure. It then writes the business object definitions to a file that can be loaded into the business integration system.

Note:
If an XML document does not have a DTD or schema document, you can manually create a business object definition for the document. For more information, see Manually creating business object definitions.

The XML ODA builds business object definitions that conform to the requirements of the XML data handler. The ODA adds the required ObjectEventId attribute to all business object definitions. It also adds the repository version number to the top of the business object file if you specify this, which is required to import a business object definition into the InterChange Server business integration system. These business object definitions do not usually need additional editing. However, if you need to perform edits, see Modifying information in the business object definition.

For information on how to use XML ODA, see Appendix A, Using the XML ODA. This appendix describes how to install and configure the XML ODA. It also describes how to use the XML ODA in Business Object Designer to generate business object definition. For information on launching Business Object Designer , see the Business Object Development Guide.

Manually creating business object definitions

This section describes how to manually create business object definitions to represent XML documents. You must ensure that you correctly define the business object definition, including its attributes, and the application-specific information.

Note:
If an XML document does not have a DTD or schema document, you must manually create a business object definition for the document. If a DTD or schema document exists, IBM recommends use of the XML ODA to create a business object definition.

The description of XML-document format for a DTD or schema document describes business object definitions that the XML ODA builds. Table 11 shows the sections of this manual that describe the format of XML documents that have a corresponding data model to describe their schema. As described in these sections, the business object definitions conform to the requirements of the XML data handler. Therefore, you can follow these descriptions when you need to create business object definitions manually.

In the following steps, ElementTypeName is the type of the XML element represented by the business object construct (either attribute or business object). To define a business object based on an XML document:

  1. Create the top-level business object definition. The name of this business object definition should be the highest level element in the XML document (name of DTD or schema document, for example) in the format: BOPrefix_TopLevelName.
    Note:
    Some connectors require a wrapper business object that contains the content business object as children. Refer to Wrapper business object definitions based on DTDs for more information.
  2. In the top-level business object definition, create attributes for the XML elements.

    For a top-level business object definition based on either a DTD or a schema document, the following attributes are required:

    For general information about these required attributes, see Business object structure. In addition, this document provides the following information about the structure of the top-level business object definition based on DTDs and schema documents:

    Data model For more information
    Document type definition (DTD) Business object structure for DTDs
    Schema document Required business object definitions for schema documents
  3. Create the root-element business object definition, which is a child object of the top-level business object definition. It contains attributes for the root XML element. The name of this business object definition should be the root element in the XML document in the format: BOPrefix_TopLevelName_RootElementName
  4. In the root-element business object definition, create a business object attribute for each contained element. Keep the following in mind:

    Note:
    For an XML document with a schema definition, the root-element business object definition can also require an attribute for the schema location. For more information, see Required business object definitions for schema documents.
  5. Create child business object definitions for all contained elements. Follow the rules listed above.

Copyright IBM Corp. 1997, 2004