498 WebSphere Business Integration Adapters
26.7 ResponseRetrieve
To create the ResponseRetrive object:
1. Open the MQInput node properties.
Figure 26-28 MQInput node
2. Set the input queue name to REDMAIN.RESPONSEQUEUE, the response
queue from the RMConnector.
3. Set the default message domain to mrm (see Figure 26-29 on page 499).
Chapter 26. Building and testing message flow for Retrieve 499
Figure 26-29 SetRouting properties
4. Open the SetRouting compute node properties and set the Compute Mode to
LocalEnvironment and Message.
5. Set the ESQL Module name to ResponseRouting.
6. Create the ESQL as shown in Example 26-4.
The ESQL does the following:
a. Copies the entire input message to be passed on.
b. Sets the routing destination based on the Verb of the message.
Example 26-4 ResponseRouting
CREATE COMPUTE MODULE ResponseRouting
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
-- CALL CopyMessageHeaders();
-- CALL CopyEntireMessage();
CALL CopyEntireMessage();
-- RESPONSE FROM TENANT RETRIEVE REQUEST
500 WebSphere Business Integration Adapters
IF InputRoot.MRM.verb = 'Retrieve'
AND InputRoot.Properties.MessageType = 'RM_Tenant' THEN
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname
='ResponseRetrieve';
ELSE
-- CREATE MAINTENANCE RESPONSE
IF InputRoot.MRM.verb = 'Create' THEN
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname
='ResponseCreate';
ELSE
-- RESPONSE FROM CONTRACTOR UPDATE REQUEST
IF InputRoot.MRM.verb = 'Update' THEN
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname
='ResponseUpdate';
END IF;
END IF;
END IF;
RETURN TRUE;
END;
CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;
CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;
END MODULE;
7. Save this ESQL.
8. Open properties of the ResponseRetrieve label (see Figure 26-30 on
page 501).
Chapter 26. Building and testing message flow for Retrieve 501
Figure 26-30 ResponseRetrieve
9. Set the LabelName to match that set in the routing ESQL.
10.Open the properties of the PrepareTenantMessage compute node (see
Figure 26-31 on page 502).
502 WebSphere Business Integration Adapters
Figure 26-31 PrepareTenantMessage compute node
11.Set the ESQL Module name to ResponseRetrieve.
12.Complete the ESQL as shown in Example 26-5 on page 503.
The ESQL performs the following:
a. Copies the message headers from input message to output message.
b. Sets up the namespace declarations for the front-end and back-end
business object definitions.
c. Sets the properties of the output message.
d. Sets the message descriptor format to indicate an RFH header is
included.
e. Sets the following RFH header values:
•Format = string
Message Domain = mrm
Message Set = WebTenant
Message Type = Web_tenant
Wire Format = CwXML
Reply queue = Adapter Result queue, even though we are not going to
do anything with these results.

Get WebSphere Business Integration Adapters: An Adapter Development and WebSphere Business Integration Solution now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.