Modifying business objects

You can modify business objects to take advantage of processing capabilities. When you modify business objects, you use Business Object Designer. For further information, see the Business Object Development Guide.

This topic contains an overview and procedure for modifying a business object to enable a synchronous request processing feature.

Overview of filtering response messages with a message selector

Upon receiving a business object for synchronous request processing, the connector checks for the presence of a response_selector string in the application-specific information of the verb. If the response_selector is undefined, the connector identifies response messages using the correlation ID as described in Retrieve, exists and retrieve by content.

If response_selector is defined, the connector expects a name-value pair with the following syntax:

response_selector=JMSCorrelationID LIKE 'selectorstring'

The message selectorstring must uniquely identify a response and its values be enclosed in single quotes as shown in the example below:

response_selector=JMSCorrelationID LIKE 'Oshkosh'

In the above example, after issuing the request message, the adapter would monitor the ReplyToQueue for a response message with a correlationID equal to "Oshkosh." The adapter would retrieve the first message that matches this message selector and then dispatch it as the response.

Steps for filtering response messages with a message selector

To filter a response message with a message selector, do the following:

  1. Launch Business Object Designer
  2. Open the business object that you want to convert for synchronous message delivery.
  3. In the application-specific information of the verb, specify response_selector=JMSCorrelationID LIKE 'selectorstring'


    where selectorstring uniquely identifies a response. When the application returns a response with the selectorstring you specified as a CorrelationID, the connector identifies it as the response to the synchronous request. The connector then calls the data handler to convert it to a response business object, and returns it to the requesting collaboration.

    Note:
    You can specify multiple selectorstrings. You can also specify special characters, reference attributes in (static and dynamic) meta-objects, and enable swapping of selectorstrings. For illustration, see the examples below.

Examples: Optionally, the adapter performs run-time substitutions enabling you to generate unique message selectors for each request. Instead of a message selector, you specify a placeholder in the form of an integer surrounded by curly braces, for example: '{1}'. You then follow with a colon and a list of comma-separated attributes to use for the substitution. The integer in the placeholder acts as an index to the attribute to use for the substitution. For example, the following message selector:

response_selector=JMSCorrelationID LIKE '{1}': MyDynamicMO.CorrelationID

would inform the adapter to replace {1} with the value of the first attribute following the selector (in this case the attribute named CorrelationId of the child-object named MyDynamicMO. If attribute CorrelationID had a value of 123ABC, the adapter would generate and use a message selector created with the following criteria:

JMSCorrelation LIKE '123ABC'

to identify the response message.

You can also specify multiple substitutions such as the following:

response_selector=PrimaryId LIKE '{1}' AND AddressId LIKE '{2}' : PrimaryId, Address[4].AddressId

In this example, the adapter would substitute {1} with the value of attribute PrimaryId from the top-level business object and {2} with the value of AddressId from the 5th position of child container object Address. With this approach, you can reference any attribute in the business object and meta-object in the response message selector. For more information on how deep retrieval is performed using Address[4].AddressId, see JCDK API manual (getAttribute method)

An error is reported at run-time when any of the following occurs:

For example, if you include the literal value '{' or '}' in the message selector, you can use '{{' or "{}" respectively. You can also place these characters in the attribute value, in which case the first "{" is not needed. Consider the following example using the escape character: response_selector=JMSCorrelation LIKE '{1}' and CompanyName='A{{P': MyDynamicMO.CorrelationID

The connector would resolve this message selector as follows:

JMSCorrelationID LIKE '123ABC' and CompanyName='A{P'

When the connector encounters special characters such as '{', '}', ':' or ';' in attribute values, they are inserted directly into the query string. This allows you to include special characters in a query string that also serve as application-specific information delimiters.

The next example illustrates how a literal string substitution is extracted from the attribute value:

response_selector=JMSCorrelation LIKE '{1}' and CompanyName='A{{P': MyDynamicMO.CorrelationID

If MyDynamicMO.CorrelationID contained the value {A:B}C;D, the connector would resolve the message selector as follows: JMSCorrelationID LIKE '{A:B}C;D' and CompanyName='A{P'

For more information on the response selector code, see JMS 1.0.1 specifications.

Copyright IBM Corp. 1997, 2004