Configuring the NameValue data handler

To configure the NameValue data handler, take the following steps:

Each of these steps is described in more detail in the following sections.

Configuring the NameValue child meta-object

To configure a NameValue data handler, you must ensure that its configuration information is provided in the NameValue child meta-object. For the NameValue data handler, IBM delivers the MO_DataHandler_DefaultNameValueConfig child meta-object. Each attribute in this meta-object defines a configuration property for the NameValue data handler.Table 61 describes the attributes for this child meta-object.

Table 61. Child meta-object attributes for the NameValue data handler

Meta-object attribute name Description Delivered default value
ClassName
Name of the data handler class to load for use with the specified MIME type. The top-level data-handler meta-object has an attribute whose name matches the specified MIME type and whose type is the NameValue child meta-object (described by Table 61). com.crossworlds. DataHandlers. text.namevalue
CxBlank
Establishes the equivalent value in the NameValue data for the special business object attribute value, Blank (the CxBlank constant). For more information, see CxBlank. CxBlank constant
CxBlankValue
This attribute is deprecated. Use the CxBlank meta-object attribute (above) to tell the data handler how the NameValue data represents the CxBlank attribute value. blank space
CxIgnore
Establishes the equivalent value in the NameValue data for the special business object attribute value, Ignore (the CxIgnore constant). For more information, see CxIgnore. CxIgnore constant
DefaultVerb
Business object verb Create
DummyKey
Key attribute required by the business integration system. 1
SkipCxIgnore
During request processing, the processing of the special attribute value CxIgnore is based on the meta-object attribute SkipCxIgnore. For more information, see CxIgnore. false
ValidateAttrCount
Determines whether the data handler looks for (or adds to the output string) a token that contains a count of attributes in the business object data. true
ObjectEventId Placeholder not used by the data handler but required by the business integration system. none

The "Delivered default value" column in Table 61 lists the value in the Default Value property for the corresponding attribute in the delivered business object. You must examine your environment and set the Default Value properties of those attributes to the appropriate values for your system and your name-value pair-formatted documents.

Note:
Use Business Object Designer to modify business object definitions.

Business object requirements

The NameValue data handler makes assumptions about the business objects that it handles. Therefore, when you pass a business object for conversion with the NameValue data handler, follow these rules:

Business object structure

There are no requirements regarding the structure of the business objects for the NameValue data handler. The data handler can process any business object.

The business objects that the data handler processes can have any name allowed by the business integration system.

Business object attribute properties

Business object architecture contains various properties that apply to attributes. Table 62 describes how the NameValue data handler interprets several of these properties and describes how to set the properties when modifying a business object definition.

Table 62. Attribute properties for business objects converted using the NameValue data handler

Property name Description
Name Each business object attribute must have a unique name.
Type Each business object attribute must have a type, such as integer, String, or the type of a contained child business object. All simple attributes must be of type String.
Key Not used by the NameValue data handler.
MaxLength Not used by the NameValue data handler.
Foreign Key Not used by the NameValue data handler.
Required Not used by the NameValue data handler.
Default Value Not used by the NameValue data handler.
Cardinality Supports cardinality 1 and cardinality n objects.

Attributes in business objects can have the special values of CxIgnore or CxBlank. The NameValue data handler takes special processing steps when attributes have these values, as described in the following sections.

CxIgnore

The CxIgnore meta-object attribute establishes the equivalent value in a NameValue data for the Ignore attribute value (the CxIgnore constant). By default, the CxIgnore meta-object attribute is set to the value of the CxIgnore constant. The data handler uses the CxIgnore meta-object attribute as follows:

Note:
Business objects must have at least one primary key that does not contain the value CxIgnore at runtime.

You can configure how the NameValue data handler processes attributes with an attribute value of CxIgnore. For example:

During request processing, the data handler is creating a serialized version of the business object. At this time, the processing of the special attribute value CxIgnore is based on the child meta-object attribute SkipCxIgnore, as follows:

Note:
With SkipCxIgnore set to true, the NameValue data handler is not bidirectional; that is, it cannot perform string-to-business-object conversions on strings that it has generated during business-object-to-string conversions.

CxBlank

The CxBlank meta-object attribute establishes the equivalent value in a NameValue data for the Blank attribute value (the CxBlank constant). By default, the CxBlank meta-object attribute is set to the value of the CxBlank constant. The data handler uses the CxBlank meta-object attribute as follows:

Note:
Business objects must have at least one primary key that does not contain the value CxBlank at runtime.

Business object application-specific information

The NameValue data handler does not require any application-specific information in business objects or their attributes. The data handler does, however, check for the existence of the cw_mo_ tag, which a business object might use to indicate any child meta-object that the connector uses. The data handler ignores any attribute identified by the cw_mo_ tag in the application-specific information of the business object. For more information about the cw_mo_ tag, see Implementing conversion from a business object.

Using existing business object definitions

The NameValue data handler can convert any business object to NameValue serialized data as long as the business object delivers data in a form that complies with the requirements of the data handler. The NameValue data handler requires each piece of data to have a name that identifies it, such as BusinessObject=Customer, Verb=Create, and CustomerName=JDoe. Because attributes must have such a name, they can be used with the NameValue data handler.

Although existing business objects that meet this requirement can be converted by the NameValue data handler, a good practice is to create your own business objects for each type of data to be processed. If you use a sample business object, or a business object developed to support the same application in another implementation, be sure to modify the definition as necessary to include only the attributes required for the implementation for which you are developing.

Therefore, to convert existing business objects to a form that closely corresponds to your data, modify the business object to provide only the data required by the application and the information required by the data handler. To adapt existing business objects for use with the NameValue data handler, do the following:

  1. Perform a functional analysis of the target application, and compare the results to existing business objects to determine the required fields of a business object definition.
  2. Use Business Object Designer to add or delete attributes from the business object definition as needed.

Copyright IBM Corp. 1997, 2003