Running the IMS Synchronous Request sample

After you have imported and deployed the sample, you can run it by following these instructions.

For an overview of how these nodes work and are configured, see IBM Information Management System (IMS) in the IBM Integration Bus documentation. This sample uses the main message flow IMSSyncRequestSample, which contains two subflows.

If you encounter any problems when you run the sample, see Resolving problems when running samples in the IBM Integration Bus documentation.

To run the sample:

  1. In the Application Development view, expand the IMSSyncRequestSampleFlowProject project.
  2. Double-click IMSSyncRequestSuccess.mbtest to open the message in the Test Client, select Enqueue.
  3. In the Detailed Properties panel, click Send Message.
    1. A WebSphere MQ Request XML message is placed on the IMS_SYNC_REQUEST_IN1 queue. This message is read by the IMSSyncRequestSample message flow.
    2. The XML message is mapped to an IMS binary format by using a Mapping node.
    3. The MQMD is saved to the local environment by using a Compute node.
    4. The IMSRequest node sends the request to IMS and receives the result of running the transaction.
    5. The response is parsed into individual segments and, based on the contents, it is treated as either a success or a failure (in this case, a success).
    6. Based on the contents of the segments, the message is then parsed either as a REXX message or a COBOL message (in this case, REXX).
    7. The parsed response is mapped to an XML format and sent to a queue.
    8. The TCPIPClientEmulation flow sends the request to the IMS_SYNC_REQUEST_OUT1 queue.
  4. Select Dequeue, in the Detailed Properties panel click Get Message.
  5. To check that the reply message has been sent successfully over WebSphere MQ, view the reply message in the Detailed Properties panel by using the XML Structure viewer. The message contains inventory details in the following format:
    <msg_INVENTORY>
      <msg_DETAILOUT>
        <do_area>2</do_area>
        <do_dept>59</do_dept>
        <do_proj>060</do_proj>
        <do_div>26</do_div>
        <do_unit_price>0.000</do_unit_price>
        <do_reqmts>  10- </do_reqmts>
        <do_on_order>  0  </do_on_order>
        <do_in_stock>  10-</do_in_stock>
        <do_disb>   136  </do_disb>
        <do_cycle>N</do_cycle>
        <do_back_order_cnt> 0</do_back_order_cnt>
      </msg_DETAILOUT>
      <msg_DETAILOUT>
        <do_area>2</do_area>
        <do_dept>59</do_dept>
        <do_proj>109</do_proj>
        <do_div>26</do_div>
        <do_unit_price>2.000</do_unit_price>
        <do_reqmts>  13  </do_reqmts>
        <do_on_order>  0  </do_on_order>
        <do_in_stock>  13 </do_in_stock>
        <do_disb>     6  </do_disb>
       <do_cycle>N</do_cycle>
        <do_back_order_cnt> 0</do_back_order_cnt>
      </msg_DETAILOUT>
    </msg_INVENTORY>
  6. To test the failure route, double-click IMSSyncRequestFailure.mbtest, the the message opens in the Test Client. Select Enqueue.
  7. In the Detailed Properties panel, click Send Message, the following events occur:
    1. Processing continues in the same way as with the success case, but this time IMS returns a single-segment error message.
    2. The error message is detected because only one segment exists, and the data is parsed with the correct message type.
    3. The error data is copied to an XML message and sent to the IMS_SYNC_REQUEST_OUT1 queue.
  8. Select Dequeue. In the Detailed Properties panel, click Get Message.
  9. To check that the reply message has been sent successfully over WebSphere MQ, view the reply message in the Detailed Properties panel by using the XML Structure viewer. The message contains error details in the following format:
    <msg_REJECTMESSAGE>
      <reject_reason>Part Number BROKEN not in DataBase</reject_reason>
    </msg_REJECTMESSAGE>

If you complete all these steps successfully, the sample is complete. Look at the nodes in the main message flows to see how the results were achieved.

Back to sample home