The connector processes business objects passed to it by a collaboration based on the verb for each business object. The connector uses business object handlers and the doForVerb() method to process the business objects that the connector supports. The connector supports the following business object verbs:
Processing of business objects with create, update and delete verbs depends on whether the objects are issued asynchronously or synchronously.
This is the default delivery mode for business objects with Create, Update, and delete verbs. A message is created from the business object using a data handler and then written to the output queue. If the message is delivered, the connector returns BON_SUCCESS, else BON_FAIL.
If a replyToQueue has been defined in the connector properties and a responseTimeout exists in the conversion properties for the business object, the connector issues a request in synchronous mode. The connector then waits for a response to verify that appropriate action was taken by the receiving application.
For JMS, the connector initially issues a message with a header as shown in
Table 1.
Field | Description | Value |
JMSType | Message Type Identifier | Output format as defined in the conversion properties if connector property MessageFormatProperty is not defined. |
JMSDeliveryMode | Message delivery Mode | Persistent. |
JMSExpiration | Message Time-To-Live | No expiration (0)* |
JMSReplyTo | Destination where a reply to this request should be sent. | Only if a response message is expected will this field be populated. |
Optional: property specified by connector property MessageFormatProperty | Alternate user-defined message property specified to contain the output format. | Output format as defined in the conversion properties if connector property MessageFormatProperty is defined. |
* Indicates current value of constant defined by JMS.
The message header described in Table 1 is followed by the message body. The message body is a business object that has been serialized using the data handler.
The thread that issued the message waits for a response message that indicates whether the receiving application was able to process the request.
When an application receives a synchronous request from the connector, it
processes the business object and issues a report message as described in Table 2 and Table 3.
Table 2. Response message descriptor header (MQMD)
Field | Description | Value |
JMSType | Message Type Identifier | Input format of business object as specified in the conversion properties (if this field was defined in the original request). |
Optional: property specified by connector property MessageFormatProperty | Alternate user-defined message property specified to contain the output format. | |
Property specified by connector property MessageResponse ResultProperty. | Result of original request issued by connector. | One of the following strings: "SUCCESS" "FAIL" "VALCHANGE" "VALDUPES" "MULTIPLE_HITS" "FAIL_RETRIEVE_BY_CONTENT" "BO_DOES_NOT_EXIST" "UNABLE_TO_LOGIN" "APP_RESPONSE_TIMEOUT". See the Connector Development Guide for Java for more information on response codes. |
Table 3. Population of response message
Verb | Feedback field | Message Body |
Create, Update, or delete | SUCCESS VALCHANGE | (Optional) A serialized business object reflecting changes. |
| VALDUPES FAIL | (Optional) An error message. |
After processing the business object, the receiving application creates a response message with the connector property MessageResponseResultProperty set to SUCCESS, FAIL or one of the other values defined in Table 2. If the business object was processed and changes occurred, the receiving application populates the response message with a serialized business object containing the changes. If the business object could not be processed, the receiving application provides an explanation in the message body that the connector returns to InterChange Server. In either case, the application sets the correlationID field of the message to the messageID of the connector message and issues it to the queue specified by the replyTo field.
Upon retrieval of a response message, the connector by default matches the correlationID of the response to the messageID of a request message. The connector then notifies the thread that issued the request. Depending on the result field of the response, the connector either expects a business object or an error message in the message body. If a business object was expected but the message body is not populated, the connector simply returns the same business object that was originally issued by InterChange Server for the Request operation. If an error message was expected but the message body is not populated, a generic error message will be returned to InterChange Server along with the response code. However, you can also use a message selector to identify, filter and otherwise control how the adapter identifies the response message for a given request. This message selector capability is a JMS feature. It applies to synchronous request processing only and is described below.
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 above.
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.
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.
Business objects with the retrieve, exists, and retrieve by content verbs support synchronous delivery only. The connector processes business objects with these verbs as it does for the synchronous delivery defined for create, update and delete. However, when using Retrieve, Exists, and Retrieve By Content verbs, the responseTimeout and replyToQueue are required. Furthermore, for retrieve by content and retrieve verbs, the message body must be populated with a serialized business object to complete the transaction.
Table 4 shows the response messages for these verbs.
Table 4. Population of response message
Verb | Feedback field | Message body |
Retrieve or RetrieveByContent | FAIL FAIL_RETRIEVE_BY_CONTENT | (Optional) An error message. |
| MULTIPLE_HITS SUCCESS | A serialized business object. |
Exist | FAIL | (Optional) An error message. |
| SUCCESS |
|