Before you run the scenarios:
- Start the adapter for JMS if it is not already
running.
- Start the Visual Test connector if it is not already
running.
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.
- Simulate the Port connector Using the Visual Test
connector, define a profile for PortConnector:
- Select File->Create/Select Profile from the Visual
Test connector menu, then select File-> New
Profile from the Connector Profile menu.
- Select the Port Connector Configuration File
PortConnector.cfg in the Samples directory, then
configure the Connector Name and Broker Type and
click OK.
- Select the profile you created and click OK.
- From the Visual Test connector menu, select
File->Connect to begin simulating.
- Test request processing
- 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.
- Change the default values if desired, set the verb to
Create and send the message by clicking Send BO.
- Check message delivery Open queue CWLD_Output
to see if a new contact message with format CON_CR has
arrived from the JMS adapter.
- 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.
- 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.
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.
- 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.
- Add the attribute Using Business Object Designer:
- Open Sample_JMS_DynMO.xsd and
Sample_JMS_Contact.xsd from the sample_folder.
- In the Sample_JMS_Contact Object window, add an
attribute named DynMO of type
Sample_JMS_DynMO.
- Double-click the Sample_JMS_Contact Object.
- Select the attributes folder and add an attribute named
DynMO of type Sample_JMS_DynMO.
- 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.
- Start the adapter for JMS if it is not already
running.
- Start the Visual Test connector if it is not already
running.
- Simulate the Port connector Using the Visual Test
connector, define a profile for PortConnector:
- Select File->Create/Select Profile from the Visual
Test connector menu, then select File-> New
Profile from the Connector Profile menu.
- Select the Port Connector Configuration File
PortConnector.cfg in the Samples directory, then
configure the Connector Name and Broker Type and click
OK.
- Select the profile you created and click OK.
- From the Visual Test connector menu, select
File->Connect to begin simulating.
- Create instances of parent business object and child meta
object Using the Visual Test Connector:
- Create a new instance of business object
Sample_JMS_Contact, changing the default values if
desired.
- Right-click on the DynMO attribute and create an
instance of it, Sample_JMS_DynMO.
- Set the new target queue
- Expand the DynMO attribute by clicking on the +
sign beside it.
- In the attribute named outputQueue, enter the name of
the target queue: REROUTE.IN
- Send the business object Click Send BO.
- 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.
