Running the scenarios

Before you run the scenarios:

  1. Start the adapter for JMS if it is not already running.
  2. Start the Visual Test connector if it is not already running.

Running the static meta-object scenario

This part of the tutorial describes a scenario using a static meta-object. For further information on static meta-objects, see Configuring a static meta-object.

  1. Simulate the Port connector Using the Visual Test connector, define a profile for PortConnector:
    1. Select File->Create/Select Profile from the Visual Test connector menu, then select File-> New Profile from the Connector Profile menu.
    2. Select the Port Connector Configuration File PortConnector.cfg in the Samples directory, then configure the Connector Name and Broker Type and click OK.
    3. Select the profile you created and click OK.
    4. From the Visual Test connector menu, select File->Connect to begin simulating.
  2. Test request processing
    1. Using the Test Connector, create a new instance of business object Sample_JMS_Contact by selecting the business object in the BoType drop-down box and then selecting Create for the BOInstance.
    2. Change the default values if desired, set the verb to Create and send the message by clicking Send BO.
  3. Check message delivery Open queue CWLD_Output to see if a new contact message with format CON_CR has arrived from the JMS adapter.
  4. Test event processing Send a message to the JMS adapter's input queue. Note: this step requires that you have a utility capable of sending messages to a queue. Otherwise, to implement an easier approach, you can set the JMS adapter's InputQueue property to CWLD_Output so that the adapter will poll its own messages. Once you have a message in the input queue, the JMS adapter will poll it and attempt to convert it into a Sample_JMS_Contact business object. The key to having the adapter poll the message is to ensure that the message format equals the value associated with the Sample_JMS_Contact business object in meta-object Sample_JMS_MO_Config. In this scenario, that format is CON_CR. If the adapter identifies the incoming message format as CON_CR, it will use the data handler to convert the message to business object Sample_JMS_Contact with the verb create. The newly created business object is subsequently delivered to the to the Test Connector.
  5. Confirm message delivery If you've performed all the above steps successfully, you should have a working scenario that enables the JMS adapter to retrieve messages and convert them to Sample_JMS_Contact business objects, and to convert Sample_JMS_Contact business objects to contact messages.

Running the dynamic meta-object scenario

This scenario demonstrates how to use a dynamic meta-object to re-route a business object to various queues defined in your JMS service provider. For further information on dynamic meta-objects, see Configuring a dynamic child meta-object. The steps below take you through creating an attribute for a child meta-object for Sample_JMS_Contact. Specifically, you will be modifying the output queue values in this child meta object to redirect the Sample_JMS_Contact business object to various queues.

The child meta-object repository, Sample_JMS_DynMO.xsd, resides in the sample_folder.

  1. Identify the dynamic meta-object attribute First you must add application-specific information to identify the attribute containing the dynamic meta-object: in Sample_JMS_Contact, add cw_mo_conn=DynMO to the application-specific information. This identifies the attribute.
  2. Add the attribute Using Business Object Designer:
    1. Open Sample_JMS_DynMO.xsd and Sample_JMS_Contact.xsd from the sample_folder.
    2. In the Sample_JMS_Contact Object window, add an attribute named DynMO of type Sample_JMS_DynMO.
    3. Double-click the Sample_JMS_Contact Object.
    4. Select the attributes folder and add an attribute named DynMO of type Sample_JMS_DynMO.
  3. Define a new target queue Define a temporary queue REROUTE.IN with the JMS service provider. This is where the dynamic meta-object will re-route the Sample_JMS_Contact business object.
  4. Start the adapter for JMS if it is not already running.
  5. Start the Visual Test connector if it is not already running.
  6. Simulate the Port connector Using the Visual Test connector, define a profile for PortConnector:
    1. Select File->Create/Select Profile from the Visual Test connector menu, then select File-> New Profile from the Connector Profile menu.
    2. Select the Port Connector Configuration File PortConnector.cfg in the Samples directory, then configure the Connector Name and Broker Type and click OK.
    3. Select the profile you created and click OK.
    4. From the Visual Test connector menu, select File->Connect to begin simulating.
  7. Create instances of parent business object and child meta object Using the Visual Test Connector:
    1. Create a new instance of business object Sample_JMS_Contact, changing the default values if desired.
    2. Right-click on the DynMO attribute and create an instance of it, Sample_JMS_DynMO.
  8. Set the new target queue
    1. Expand the DynMO attribute by clicking on the + sign beside it.
    2. In the attribute named outputQueue, enter the name of the target queue: REROUTE.IN
  9. Send the business object Click Send BO.
  10. Confirm message delivery Open queue REROUTE.IN to see if a new contact message has arrived from the JMS adapter. If a new message has arrived from the JMS adapter to the queue named REROUTE.IN, then the re-routing has worked.

Copyright IBM Corp. 1997, 2003