266 Using IBM WebSphere Message Broker as an ESB with WebSphere Process Server
CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;
END MODULE;
RespondToHTTPRequest node
The RespondToHTTPRequest HTTPReply node (Figure 8-47) replies to the
original HTTP requester.
Figure 8-47 The RespondToHTTPRequest node
8.5.7 Supplier1 message flow
The Supplier1 message flow (Figure 8-48 on page 267) emulates the Supplier1
system, responding to the aggregate request. The Supplier1 message flow
emulates a enterprise information system that communicates using the MQ
transport and can only read messages in the CWF1 message format. The
Supplier1 message flow demonstrates conversion of the message back to XML
format as it builds the response message.
Note: The Supplier1 message flow emulates the Supplier1 system. It is not
part of the aggregation process, but rather the service that one of the
aggregated messages is sent to. In a production system, these services are
probably not implemented with message flows. However, we include this
because it illustrates converting a CWF message to the XML format.
Chapter 8. Scenario: Aggregation 267
Figure 8-48 Supplier1 message flow
The Supplier1 message flow has the following nodes:
? The
Supplier1RequestInput MQInput node receives the request and validates
that the message is in CWF message format.
? The
BuildSupplier1Response Compute node takes a message in the CWF
message format and uses it to build the response in the XML message
format.
? The
Supplier1Reply MQReply node sends the message to the queue
specified in the reply-to queue field in the message. This field was previously
set in the AggRequestToSupplier1 MQOutput node in the
FindSuppliersAggFanIn.msgflow.
Supplier1RequestInput MQInput node
The basic properties (Figure 8-49) of the Supplier1RequestInput MQInput node
define the queue that the flow uses to receive messages.
Figure 8-49 Basic properties of the Supplier1RequestInput node
268 Using IBM WebSphere Message Broker as an ESB with WebSphere Process Server
The input message parsing properties (Figure 8-50) define how this message
should be modeled upon input.
Figure 8-50 Input message parsing properties of the Supplier1RequestInput node
The validation properties (Figure 8-51) dictate that the input message should be
checked for content and value. If validation fails, an exception is appended to the
message and sent to failure terminal of this node. The failure terminal is
connected to the Supplier1Error node, which logs the exception to the system
log. If validation is successful, the message is passed to the
BuildSupplier1Response node for processing.
Figure 8-51 Validation properties of the Supplier1RequestInput node
Chapter 8. Scenario: Aggregation 269
Supplier1Error Trace node
The basic properties (Figure 8-52) of the Supplier1Error Trace node are set to
write any exception to a local error log. This node is invoked should an error
occur in the Supplier1 message flow.
Figure 8-52 Basic properties of the Supplier1Error Trace node
Example 8-5 shows the full code in the Pattern field.
Example 8-5 Pattern of the error written to the local error log
Date is: ${EXTRACT (MONTH FROM CURRENT_DATE)}/${EXTRACT (DAY FROM
CURRENT_DATE)}/${EXTRACT (YEAR FROM CURRENT_DATE)}
Time is: ${EXTRACT (HOUR FROM CURRENT_TIMESTAMP)}:${EXTRACT(MINUTE FROM
CURRENT_TIMESTAMP)}
*** A Supplier1 flow error condition occurred. ***
Environment is:
${Environment}
Exception List is:
${ExceptionList}
The Message is:
${Root}
270 Using IBM WebSphere Message Broker as an ESB with WebSphere Process Server
BuildSupplier1Response Compute node
The basic properties (Figure 8-53) of the BuildSupplier1Response Compute
node define the location of the ESQL module that is used to implement the logic
of this node.
Figure 8-53 Basic properties of the BuildSupplier1Response node
Example 8-6 shows the ESQL, which changes the wire format of the message
from CWF to XML as it builds the response. The values are hard coded because
it is not the intent of this scenario to demonstrate any logic in the Supplier1
system.
Example 8-6 ESQL for the BuildSupplier1Response node
CREATE COMPUTE MODULE Supplier1_BuildSupplier1Response
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
-- First, we copy the message headers
CALL CopyMessageHeaders();
-- Next, we set the properties of the output
-- message since we convert from CWF to XML format
SET OutputRoot.Properties.MessageSet = 'PJLEJ0S002001';
SET OutputRoot.Properties.MessageType = 'FindSuppliersOperationResponse';
SET OutputRoot.Properties.MessageFormat = 'XML1';
-- Next, we create the MRM domain to store the response
CREATE LASTCHILD OF OutputRoot DOMAIN 'MRM';
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.175.21