Configuring meta-object attributes

The adapter for WebSphereCommerce can recognize and read two kinds of meta-objects:

The attribute values of the dynamic child meta-object duplicate and override those of the static meta-object.

Static meta-objects

A WebSphereCommerce static meta-object consists of a list of conversion properties defined for different business objects. To define the conversion properties for a business object, first create a string attribute and name it using the syntax busObj_verb. For example, to define the conversion properties for a Customer object with the verb Create, create an attribute named Customer_Create. In the application-specific text of the attribute, you specify the actual conversion properties.

Additionally, a reserved attribute named Default can be defined in the meta-object. When this attribute is present, its properties act as default values for all business object conversion properties.

Note:
If a static meta object is not specified, the connector is unable to map a given message format to a specific business object type during polling. When this is the case, the connector passes the message text to the configured data handler without specifying a business object. If the data handler cannot create a business object based on the text alone, the adapter reports an error indicating that this message format is unrecognized.

Table 15 describes the meta-object properties.

Table 15. WebSphere Commerce static meta-object properties
Property name Description
CollaborationName
Note:
This property is only for synchronous event handling, which is not supported in this version of the adapter.
DataEncoding

DataEncoding is the encoding to be used to read and write messages. If this property is not specified in the static meta-object, the connector tries to read the messages without using any specific encoding. DataEncoding defined in a dynamic child meta-object overrides the value defined in the static meta-object. The default value is Text. The format for the value of this attribute is messageType[:enc]. I.e., Text:ISO8859_1, Text:UnicodeLittle, Text, or Binary.

DataHandlerConfigMO

Meta-object passed to data handler to provide configuration information. If specified in the static meta-object, this will override the value specified in the DataHandlerConfigMO connector property. If defined in a dynamic child meta-object, this property will override the connector property and the static meta-object property. The specified business object must be supported by the adapter.

DataHandlerMimeType

Specifies the data handler based on a particular MIME type. You must use the text/xml MIME type in order for the adapter to interact with WebSphere Commerce.

If specified in the static meta-object, this property will override the value specified in the DataHandlerMimeType connector property. If defined in a dynamic child meta-object, this property will override the connector property and the static meta-object property. The business object specified in DataHandlerConfigMO should have an attribute that corresponds to the value of this property.

DoNotReportBusObj

Optionally, the user can include the DoNotReportBusObj property. By setting this property to true, all PAN report messages issued will have a blank message body. This is recommended when a requestor wants to confirm that a request has been successfully processed and does not need notification of changes to the business object. This does not effect NAN reports.

If this property is not found in the static meta-object, the adapter will default it to false and populate the message report with the business object.

Note:
This property is only for synchronous event handling, which is not supported in this version of the adapter.
InputFormat

The InputFormat is the message format to associate with the given business object. When a message is retrieved and is in this format, it is converted to the given business object if possible.

OutputFormat

The OutputFormat is set on messages created from the given business object. If the OutputFormat is not specified, the input format is used, if available. An OutputFormat defined in a dynamic child meta-object overrides the value defined in the static meta-object.

InputQueue The input queue that the connector polls to detect new messages. You can use connector-specific properties to configure multiple InputQueues and optionally map different data handlers to each queue.
OutputQueue

The OutputQueue is the output queue to which messages derived from the given business object are delivered. An OutputQueue defined in a dynamic child meta-object overrides the value defined in the static meta-object.

ResponseTimeout

Indicates the length of time in milliseconds to wait before timing out when waiting for a response. The adapter returns SUCCESS immediately without waiting for a response if this is left undefined or with a value less than zero. A ResponseTimeout defined in a dynamic child meta-object overrides the value defined in the static meta-object.

TimeoutFatal

If this property is defined and has a value of True, the adapter returns APP_RESPONSE_TIMEOUT when a response is not received within the time specified by ResponseTimeout. All other threads waiting for response messages immediately return APP_RESPONSE_TIMEOUT to InterChange Server. This causes InterChange Server to terminate the adapter. A TimeoutFatal defined in a dynamic child meta-object overrides the value defined in the static meta-object.


Table 16. JMS static meta-object structure for Customer_Create
Attribute name Application-specific text
Customer_Create DataEncoding=Text:UnicodeLittle; InputFormat=CUST_IN; OutputFormat=CUST_OUT; OutputQueue=QueueA; ResponseTimeout=10000; TimeoutFatal=False

Application-specific text

The application-specific text is structured in name-value pair format, separated by semicolons. For example:

InputFormat=CUST_IN;OutputFormat=CUST_OUT
 

Mapping data handlers to InputQueues

You can use the InputQueue property in the application-specific information of the static meta-object to associate a data handler with an input queue. This feature is useful when dealing with multiple trading partners who have different formats and conversion requirements. To do so you must:

  1. Use connector-specific properties (see InputQueue) to configure one or more input queues.
  2. For each input queue, specify the queue manager and input queue name as well as data handler class name and mime type in the application-specific information.

For example, the following attribute in a static meta-object associates a data handler with an InputQueue named CompReceipts:

[Attribute]
 Name = Cust_Create
 Type = String
 Cardinality = 1
 MaxLength = 1
 IsKey = false
 IsForeignKey = false
 IsRequired = false
 AppSpecificInfo = InputQueue=//queue.manager/CompReceipts;
   DataHandlerClassName=com.crossworlds.
 DataHandlers.MQ.disposition_notification;DataHandlerMimeType=message/
 disposition_notification
 IsRequiredServerBound = false
 [End]
 

Overloading input formats

When retrieving a message, the connector normally matches the input format to one specific business object and verb combination. The adapter then passes the business object name and the contents of the message to the data handler. This allows the data handler to verify that the message contents correspond to the business object that the user expects.

If, however, the same input format is defined for more than one business object, the connector will be unable to determine which business object the data represents before passing it to the data handler. In such cases, the adapter passes the message contents only to the data handler and then looks up conversion properties based on the business object that is generated. Accordingly, the data handler must determine the business object based on the message content alone.

If the verb on the generated business object is not set, the connector searches for conversion properties defined for this business object with any verb. If only one set of conversion properties is found, the connector assigns the specified verb. If more properties are found, the connector fails the message because it is unable to distinguish among the verbs.

A sample meta-object

The meta-object shown below configures the connector to convert Customer business objects using the verb Create.

[BusinessObjectDefinition]
 Name = MO_WebSphereCommerceConfig
 Version = 3.0.0
  
    [Attribute]
    Name = Default
    Type = String
    MaxLength = 1
    IsKey = true
    IsForeignKey = false
    IsRequired = false
    AppSpecificInfo = OutputQueue=queue://<Queue Manager
     Name>/WCS_Serial_Inbound?targetClient=1;
      OutputFormat=MQSTR
    IsRequiredServerBound = false
    [End]
    [Attribute]
    Name = WCS_Create_WCS_Customer_Create
    Type = String
    MaxLength = 255
    IsKey = false
    IsForeignKey = false
    IsRequired = false
    AppSpecificInfo = OutputQueue=queue://<Queue Manager
     Name>/WCS_Serial_Inbound?targetClient=1;
      OutputFormat=MQSTR
    IsRequiredServerBound = false
    [End]
    [Attribute]
    Name = WCS_Report_NC_PurchaseOrder_Create
    Type = String
    MaxLength = 255
    IsKey = false
    IsForeignKey = false
    IsRequired = false
    AppSpecificInfo = InputFormat=MQSTR
    IsRequiredServerBound = false
    [End]
    [Attribute]
    Name = ObjectEventId
    Type = String
    MaxLength = 255
    IsKey = false
    IsForeignKey = false
    IsRequired = false
    IsRequiredServerBound = false
    [End]
  
    [Verb]
    Name = Create
    [End]
  
    [Verb]
    Name = Delete
    [End]
  
    [Verb]
    Name = Retrieve
    [End]
  
    [Verb]
    Name = Update
    [End]
 [End]
 

Dynamic child meta-objects

If it is difficult to specify the meta-data through a static meta-object, the connector can accept meta-data specified at run time for each business object instance.

The connector recognizes and reads conversion properties from a dynamic meta-object added as a child to the top-level business object passed to the connector. The attribute values of the dynamic child meta-object duplicate the conversion properties that you can specify via the static meta-object that is used to configure the connector.

Since dynamic child meta object properties override those found in static meta-objects, if you specify a dynamic child meta-object, you need not include a connector property that specifies the static meta-object. Accordingly, you can use a dynamic child meta-object independently of the static meta-object and vice-versa.

Table 16 and Table 17 show sample static and dynamic child meta-objects, respectively, for business object Customer_Create. Note that the application-specific text consists of semi-colon delimited name-value pairs.

Table 17. WebSphereCommerce Dynamic Child Meta-Object Structure for Customer_Create
Attribute name Value
DataEncoding Text:UnicodeLittle
DataHandlerMimeTypea text/delimited
OutputFormat CUST_OUT
OutputQueue QueueA
ResponseTimeout 10000
TimeoutFatal False

a. Assumes that DataHandlerConfigMO has been specified in either the connector configuration properties or the static meta-object.

The connector checks the application-specific text of top-level business objects to determine whether tag cw_mo_conn specifies a child meta-object. If so, the dynamic child meta-object values override those specified in the static meta-object.

Activity during polling

In order to provide collaborations with more information regarding messages retrieved during polling, the connector populates specific attributes of the dynamic meta-object, if already defined for the business object created.

Table 18 shows how a dynamic child meta-object might be structured for polling.

Table 18. JMS dynamic child meta-object structure for polling
Attribute name Sample value
InputFormat CUST_IN
InputQueue MYInputQueue
OutputFormat CxIgnore
OutputQueue CxIgnore
ResponseTimeout CxIgnore
TimeoutFatal CxIgnore

As shown in Table 18, you can define an additional attribute, InputQueue, in a dynamic child meta-object. This attribute contains the name of the queue from which a given message has been retrieved. If this property is not defined in the child meta-object, it will not be populated.

Example scenario:

Sample dynamic child meta-object

[BusinessObjectDefinition]
 Name = MO_Sample_Config
 Version = 1.0.0
  
    [Attribute]
    Name = OutputFormat
    Type = String
    MaxLength = 1
    IsKey = true
    IsForeignKey = false
    IsRequired = false
    DefaultValue = CUST
    IsRequiredServerBound = false
    [End]
    [Attribute]
    Name = OutputQueue
    Type = String
    MaxLength = 1
    IsKey = false
    IsForeignKey = false
    IsRequired = false
    DefaultValue = OUT
    IsRequiredServerBound = false
    [End]
    [Attribute]
    Name = ResponseTimeout
    Type = String
    MaxLength = 1
    IsKey = false
    IsForeignKey = false
    IsRequired = false
    DefaultValue = -1
    IsRequiredServerBound = false
    [End]
    [Attribute]
    Name = TimeoutFatal
    Type = String
    MaxLength = 1
    IsKey = false
    IsForeignKey = false
    IsRequired = false
    DefaultValue = false
    IsRequiredServerBound = false
    [End]
    [Attribute]
    Name = InputFormat
    Type = String
    MaxLength = 1
    IsKey = true
    IsForeignKey = false
    IsRequired = false
    IsRequiredServerBound = false
    [End]
    [Attribute]
    Name = InputQueue
    Type = String
    MaxLength = 1
    IsKey = false
    IsForeignKey = false
    IsRequired = false
    IsRequiredServerBound = false
    [End]
    [Attribute]
    Name = ObjectEventId
    Type = String
    MaxLength = 255
    IsKey = false
    IsForeignKey = false
    IsRequired = false
    IsRequiredServerBound = false
    [End]
  
    [Verb]
    Name = Create
    [End]
  
    [Verb]
    Name = Delete
    [End]
  
    [Verb]
    Name = Retrieve
    [End]
  
    [Verb]
    Name = Update
    [End]
 [End]
 [BusinessObjectDefinition]
 Name = Customer
 Version = 1.0.0
 AppSpecificInfo = cw_mo_conn=MyConfig
  
    [Attribute]
    Name = FirstName
    Type = String
    MaxLength = 1
    IsKey = true
    IsForeignKey = false
    IsRequired = false
    IsRequiredServerBound = false
    [End]
    [Attribute]
    Name = LastName
    Type = String
    MaxLength = 1
    IsKey = true
    IsForeignKey = false
    IsRequired = false
    IsRequiredServerBound = false
    [End]
    [Attribute]
    Name = Telephone
    Type = String
    MaxLength = 1
    IsKey = false
    IsForeignKey = false
    IsRequired = false
    IsRequiredServerBound = false
    [End]
    [Attribute]
    Name = MyConfig
    Type = MO_Sample_Config
    ContainedObjectVersion = 1.0.0
    Relationship = Containment
    Cardinality = 1
    MaxLength = 1
    IsKey = false
    IsForeignKey = false
    IsRequired = false
    IsRequiredServerBound = false
    [End]
    [Attribute]
    Name = ObjectEventId
    Type = String
    MaxLength = 255
    IsKey = false
    IsForeignKey = false
    IsRequired = false
    IsRequiredServerBound = false
    [End]
  
    [Verb]
    Name = Create
    [End]
  
    [Verb]
    Name = Delete
    [End]
  
    [Verb]
    Name = Retrieve
    [End]
  
    [Verb]
    Name = Update
    [End]
 [End]
 

Copyright IBM Corp. 1997, 2003