WebSphere Message Brokers
File: ar25250_1_
Writer: Cerys Giddings

Task topic

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

Develop a message flow

This is the first stage of the scenario to use a broker as an auditor. This topic demonstrates how to develop a message flow to map several fields of input data into a single insert record for a database. It also involves updating another table and deleting a third table, as well as developing corresponding message models and instance messages.
  1. Create a database called MAPDB and a table called CONFIRMATION, which contains the following columns:
    RESID                INTEGER
  2. Populate the CONFIRMATION table with the value shown:
    9052 
  3. Create another table called RESERVATION, which contains the following columns:
    RESID           INTEGER
    NAME            VARCHAR(20)
    PARTY           INTEGER
    PAYMENT         DECIMAL(8,2)
  4. Populate the RESERVATION table with the values shown:
    8214,'ARCHIBALD',2,0.0
    2618,'HENRY', 4, 120.0
    9052,'THAW', 3, 85.0
  5. Create another table called PROVISIONAL, which contains the following columns:
    RESID                  INTEGER
  6. Populate the PROVISIONAL table with the values shown:
     8214 2618 
  7. Create a Windows ODBC Data Source Name for the database, and register the database with the Configuration Manager by clicking File > New > Database Definition Files.
  8. Create a message set project and a message set called MAPPING3_AUDIT_messages (ensuring that the message set is namespace enabled, with XML wire format) and create a message definition file called AUDIT.
  9. Create a message called addev1, which has the structure:
    addev1
       id                (xsd:int) local element
       status            (xsd:string) local element
       name              (xsd:string) local element
       size              (xsd:int) local element
       payment           (xsd:decimal) local element
  10. Create a message flow project called MAPPING3_AUDIT_flows.
  11. Create a message flow called addev1, which contains the following mapping: MQInput ->DataInsert -> DataUpdate -> DataDelete -> MQOutput.
  12. For the DataInsert node, set the Data Source property to MAPDB.
  13. Open the mapping for the DataInsert node and select MAPPING3_AUDIT_messages addev1 as the source, and MAPDB.SCHEMA.CONFIRMATION as the target.
  14. Wire the source to the target as shown:
    addev1             MAPDB
           id -------------- RESID
  15. For the DataUpdate node, set the Data Source property to MAPDB.
  16. Open the mapping for the DataUpdate node and select MAPPING3_AUDIT_messages addev1 as the source, and MAPDB.SCHEMA.RESERVATION as the target.
  17. Wire the source to the target as shown:
    addev1             MAPDB
           id -------------- RESID
           name ---------- NAME
           size ------------ PARTY
           payment ------- PAYMENT
  18. In the Spreadsheet pane, select $db:update and change fn:true() to $db:update.MAPDB.MQSI.RESERVATION.RESID = $source/addev1/id and $source/addev1/status = 'CONFIRM'.
  19. For the DataDelete node, set the Data Source property to MAPDB.
  20. Open the mapping for the DataDelete node and select MAPPING3_AUDIT_messages addev1 as the source, and MAPDB.SCHEMA.PROVISIONAL as the target.
  21. In the Spreadsheet pane, select $db:delete and change fn:false() to $db:delete.MAPDB.MQSI.PROVISIONAL.RESID = $source/addev1/id.
  22. Create the following instance message with appropriate RFH2 headers:
    <addev1>
    <id>8214</id>
    <status>CONFIRM</status>
    <name>ARCHIBALD</name>
    <size>2</size>
    <payment>1038.0</payment>
    </addev1>
You have created the following resources:
Now go to Deploy the message set and message flow.
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:20

ar25250_1_ This topic's URL is: