WebSphere Message Brokers
File: ar25251_1_
Writer: Cerys Giddings

Task topic

This build: July 31, 2007 21:36:24

Develop a message flow that contains other nodes

This is the first stage of the scenario to perform complex message enrichment. This topic demonstrates the following procedures:
  1. From the Broker Application Development perspective, create the following resources:
    • a message set project and a message set called MAPPING3_COMPLEX_messages, ensuring that the message set is namespace enabled with XML wire format
    • a message definition file called COMPLEX, which has a target namespace www.complex.net, with prefix comp
  2. Create messages addev1, addev1s and addev1n with the following structures:
    addev1
       bool      (xsd:boolean) local element
       bin        (xsd:hexBinary) local element
       dat        (xsd:dateTime) local element
       dec       (xsd:decimal) local element
       dur        (xsd:duration) local element
       flt          (xsd:float) local element
       int         (xsd:int) local element
       str         (xsd:string) local element   
    addev1s
       bin        (xsd:hexBinary) local element
       dat        (xsd:dateTime) local element
       dur        (xsd:duration) local element
       str         (xsd:string) local element
    addev1n
       dec       (xsd:decimal) local element
       flt          (xsd:float) local element
       int         (xsd:int) local element
  3. Create a message flow project called MAPPING3_COMPLEX_flows.
  4. Create a message flow called addev1 which contains:
    MQInput ->Filter -> Mapping -> Compute
                         \                       \ --> RCD -> MQOutput
                          \-> Mapping1-----------/ 
  5. In the Filter node, set the following ESQL:
    IF Body.bool THEN
                RETURN TRUE;
            ELSE
                RETURN FALSE;
            END IF;
  6. In the Mapping node that is connected to the Filter true terminal (Mapping1), open the map and select addev1 as source and addev1s as target.
  7. Wire the source to target as shown:
    bin --- bin
    dat --- dat
    dur --- dur
    str --- str
  8. In the Spreadsheet pane, expand Properties and set the following values:
    MessageType   |     'addev1s'
  9. Right-click the target dat and click If.
  10. Replace the condition fn:true() with $source/comp:addev1/str = 'dat'.
  11. Set the value for dat to $source/comp:addev1/dat + xs:duration("P3M").
  12. Right-click the condition and click Else.
  13. Right-click the target dur and click If.
  14. Replace the condition fn:true() with $source/comp:addev1/str = 'dur'.
  15. Set the value for dur to $source/comp:addev1/dur + xs:duration("P1Y").
  16. Right-click the condition and click Else.
  17. Open the map for the node that is connected to the false terminal of the Filter node (Mapping) and select addev1 as source and addev1n as target.
  18. Wire the source to target as shown:
    dec --- dec
    flt --- flt
    int --- int
  19. In the Spreadsheet pane, expand Properties and set the following values:
    MessageType     |     'addev1n'
  20. Set the ESQL in the Compute node to:
    CALL CopyMessageHeaders();
            SET OutputRoot.MRM.dec = InputBody.dec * 10;
            SET OutputRoot.MRM.flt = InputBody.flt * 10;
            SET OutputRoot.MRM.int = InputBody.int * 10;
  21. In the ResetContentDescriptor node, set the Message Domain to XMLNS and select the Reset Message Domain check box.
  22. Create three instance messages with the appropriate RFH2 headers:
    <comp:addev1 xmlns:comp="http://www.complex.net">
    <bool>1</bool>
    <bin><![CDATA[010203]]></bin>
    <dat>2005-05-06T00:00:00+00:00</dat>
    <dec>19.34</dec>
    <dur>P2Y4M</dur>
    <flt>3.245E+2</flt>
    <int>2104</int>
    <str>dat</str>
    </comp:addev1>
    <comp:addev1 xmlns:comp="http://www.complex.net">
    <bool>1</bool>
    <bin><![CDATA[010203]]></bin>
    <dat>2005-05-06T00:00:00+00:00</dat>
    <dec>19.34</dec>
    <dur>P2Y4M</dur>
    <flt>3.245E+2</flt>
    <int>2104</int>
    <str>dur</str>
    </comp:addev1>
    <comp:addev1 xmlns:comp="http://www.complex.net">
    <bool>0</bool>
    <bin><![CDATA[010203]]></bin>
    <dat>2005-05-06T00:00:00+00:00</dat>
    <dec>19.34</dec>
    <dur>P2Y4M</dur>
    <flt>3.245E+2</flt>
    <int>2104</int>
    <str>dat</str>
    </comp:addev1>
You have created the following resources:
Now deploy the message set and message flow.

Deploy the message set and message flow

This is the second stage of the scenario to perform complex message enrichment. This topic demonstrates how to deploy the message set and message flow and run the instance messages through the broker.
  1. Create a bar file called addev1.
  2. Add the message set MAPPING3_COMPLEX_messages and the message flow addev1 to the bar file.
  3. Deploy the bar file to the broker.
  4. Put the instance documents on the input queue.
The output messages look like this:
<comp:addev1s xmlns:comp="http://www.complex.net">
<bin><![CDATA[010203]]></bin>
<dat>2005-08-06T00:00:00-01:00</dat>
<dur>P2Y4M</dur>
<str>dat</str>
</comp:addev1s>
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:36:24

ar25251_1_ This topic's URL is: