Follow these steps to run the application
Open the LookupCountyFullName message flow from the application and complete the following steps:
- Click the Flow Exerciser icon
to start recording the message path through the flow.
- Click the Send Message icon
to select the first message to send to the flow.
- Select the 'Berks' input message, and click Send.
The request message is sent to the HTTP Input node, and the response message containing the full name, 'Berkshire', is received.
- Close the Send message dialog.
The message path is automatically highlighted on the message flow. Note: The message path shows that the message was sent through the 'File Read' and 'LoadCache' Mapping nodes. Because the Lookup table was not in the Global Cache, the 'LookupCountyFullName' Mapping node cannot find a match.
- Click on any connection to see the data that passed through that connection.
- Click the Send Message icon
again, to select the 'Hants' message and send it to the flow by clicking Send.
- Review the received message and close the Send message dialog to see the message path.
Note: The message path shows that the message was sent directly to the 'HTTP Reply' node. Because the Lookup table is in the Global Cache, the 'LookupCountyFullName' Mapping node found a match and set the 'CountyFullName'.
If you restart the integration node, or issue a mqsicacheadmin command to clear the Global Cache, the next message is sent through the 'File Read' and 'LoadCache' Mapping nodes again.
The following optional steps help you explore and understand the application
The LookupCountyFullName message flow uses an HTTP Input node to receive a JSON message that contains a 'CountyAbbr' value. The 'CountyAbbr' value is used in the 'LookupCountyFullName' Mapping node to lookup the replacement full county name from the Global Cache.
- Double click the 'LookupCountyFullName' Mapping node to open the associated Graphical Data Map that includes the 'Cache Get' transform.
- Click the 'Local map' to enter the nested mapping. Note: The value for the input element, 'CountyAbbr', is placed in the 'Environment' so that it is not overwritten by the data that is retrieved from the 'CountyAbbrNames.csv file.
- Click the 'Cache Get' transform to enter the nested mapping for the transform and review the mapping of the 'Key' that is used to select the entry in the Lookup table. Note: 'MapName' is set by using a CustomXPath transform to configure a user-defined property.
- Click the up arrow
to exit the nested mapping, then click the 'Cache Return' transform to enter the nested mapping for the transform and review the mapping from the 'Value' that is returned from the Global Cache.
- Click the 'Move' transform and view the Condition tab in the Properties, to see that the 'Value' element is created only if an entry is found in the Global Cache.
- Return to the message flow editor.
The 'FoundCountyFullName' Route node checks for the presence of the 'CountyFullName' value:
- If the 'CountyFullName' value exists, the message is routed directly to the 'HTTP Reply' node.
- If the 'CountyFullName' value does not exist (for example, if the Lookup table in the Global Cache is not populated), the message is routed to the 'File Read' node. The 'File Read' node retrieves name-value pairs from a comma-separated-values file that is parsed by using a DFDL CSV model. The name-value data is passed to the 'LoadCache' Mapping node, where the data is loaded into a Lookup table in the Global Cache. The 'LoadCache' mapping node also sets the 'CountyFullName' value in the output message.
- Double click the 'LoadCache' Mapping node to open and explore the map and review the use of the 'Cache Put' transform within the 'For each' transform. Note: The value of 'CountyFullName' for the current lookup request is taken directly from the data that is read from the comma-separated-values file.