MQGet node message tree examples

The MQGet node generates message trees based on the input message assembly that it receives, and the options that you have set on the node properties.

The message trees, shown in the following table, are generated according to the rules described in How the MQGet node implements IBM MQ MQGet API calls.

With a message assembly like this: The message that the MQGet node returns is:
InputRoot
MQMD
{input message MQMD}
MQRFH2
{input message MQRFH2}
XMLNS
{input message body}
InputLocalEnvironment
MQ
GET
MQGMO
MatchOptions = MQMO_MATCH_CORREL_ID
MQMD (with no children)
Variables
MQMD
{input MQMD} (with CorrelID = {correct Correlation ID as binary})
ResultRoot
MQMD
{result message MQMD}
MQRFH2
{result message MQRFH2}
XML
{result message body}
With the following node property settings: The resulting output message assembly is:
Input MQMD Location
InputLocalEnvironment.Variables.MQMD
Copy Message
Copy Entire Message
Copy Local Environment
Copy Entire LocalEnvironment
Generate Mode
Message and LocalEnvironment
Output Data Location
InputLocalEnvironment.Variables.ReturnedMessage
OutputRoot
MQMD
{input message MQMD}
MQRFH2
{input message MQRFH2}
XMLNS
{input message body}
OutputLocalEnvironment
MQ
GET
MQGMO
{MQGMO used for MQGET}
MQMD
{MQMD used for MQGET}
CC = 0
RC = 0
Variables
MQMD
{input MQMD} (with CorrelID = {correct Correlation ID as binary})
ReturnedMessage
MQMD
{result message MQMD}
MQRFH2
{result message MQRFH2}
XML
{result message body}
Result Data Location
ResultRoot.XML
OutputRoot
MQMD
{input message MQMD}
MQRFH2
{input message MQRFH2}
XMLNS
{input message body}
OutputLocalEnvironment
MQ
GET
MQGMO
{MQGMO used for MQGET}
MQMD
{MQMD used for MQGET}
CC = 0
RC = 0
Variables
MQMD
{input MQMD} (with CorrelID = {correct Correlation ID as binary})
ReturnedMessage (with any attributes and value from ResultRoot.XML)
{result message body}

This tree is effectively the result of doing an assignment from ${resultDataLocation} to ${outputDataLocation}. The value of the source element is copied, as are all children including attributes.

Copy Local Environment
None
OutputRoot
MQMD
{input message MQMD}
MQRFH2
{input message MQRFH2}
XMLNS
{input message body}
OutputLocalEnvironment
MQ
GET
MQGMO
{MQGMO used for MQGET}
MQMD
{MQMD used for MQGET}
CC = 0
RC = 0
Variables
ReturnedMessage (with any attributes and value from ResultRoot.XML)
{result message body}

This tree has the MQMD that is used for the MQGET call in the OutputLocalEnvironment, because the input MQ parameters location had an MQMD element under it. Even though the input tree is not copied, the presence of the MQMD element causes the MQMD that is used for the MQGET call to be placed in the output tree.

Output Data Location
<blank>
Copy Local Environment
Copy Entire Local Environment
OutputRoot
MQMD
{result message MQMD}
MQRFH2
{result message MQRFH2}
XMLNS
{result message body}
OutputLocalEnvironment
MQ
GET
MQGMO
{MQGMO used for MQGET}
MQMD
{MQMD used for MQGET}
CC = 0
RC = 0
Variables
MQMD
{input MQMD} (with CorrelID = {correct Correlation ID as binary})

The value that you set for the Copy Message property makes no difference to the eventual output tree in this case.