Tutorial: Building Your First Business Process

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Using the Message Broker

Part IV of this tutorial is comprised of Steps 13 through 15. You build on the business process you created in Adding Looping Logic, Parallel Paths . . ..

The Message Broker provides a publish and subscribe message-based communication model for WebLogic Integration business processes, and includes a message filtering capability. In this scenario, your RequestQuote business process publishes the Request for Quote message it receives from a client to a Message Broker channel. A number of services, which validate the Request for Quote in some way, can subscribe to that channel. If the request is determined to be invalid by one of these services, that service publishes a message on a second Message Broker channel, to which the RequestQuote process is subscribed. If the running RequestQuote process receives such a message, it is terminated and a message is sent to the client indicating why the quote is not processed.

One external service that validates the Request for Quote as well as a Channel file that specifies two Message Broker channels are provided for you to support the tutorial scenario. You learn about creating Message Broker channels, publishing and subscribing to those channels, and designing your business process to handle the receipt of an out-of-bound message that causes it to terminate.

To learn about the WebLogic Integration Message Broker, see Introducing the Message Broker. For a description of the scenario modeled in this part of the tutorial, see Understanding the Validation Service Scenario.

The steps in Part IV include:

Step 13: Publish and Subscribe to Message Broker Channels

Build on the business process you created in Parts I through III of the tutorial by designing nodes in your RequestQuote business process that specify how the business process publishes the Request for Quote to a Message Broker channel and how it subscribes to a Message Broker channel.

Step 14: Designing a Message Path for Your Business Process

Add a message path to handle the callback from the Message Broker channel to which your business process is subscribed, and specify the actions taken by the RequestQuote process when such a callback is received.

Step 15: Run and Test the Request Quote Business Process With the Quote Validation Service

Run and test your expanded Request for Quote business process.

Introducing the Message Broker

The Message Broker provides typed channels, to which messages can be published, and to which services can subscribe to receive messages. You can design your system for subject-based or content-based routing of messages:

Two Message Broker controls are available when you build WebLogic Integration applications: Message Broker (MB) Publish and Message Broker (MB) Subscription. Business processes use MB Publish controls to publish messages to channels and MB Subscription controls to dynamically subscribe to channels and receive messages:

In addition to the dynamic subscriptions you design at the Control nodes in your business process, you can design static subscriptions at Start nodes. A business process that is subscribed to a Message Broker channel at its Start node starts when a message is received on the channel to which it is subscribed.

To learn more about using the Message Broker controls in WebLogic Integration applications, see Message Broker Controls.

Understanding the Validation Service Scenario

A service that validates a Request for Quote and a channel file that defines two Message Broker channels are provided for you in the tutorial application. The validation service is a process (ValidateOrder.jpd) that subscribes to a Message Broker channel named ValidateOrder. It validates the client's Request for Quote based on the number of widgets requested. ValidateOrder.java starts when a Request for Quote message is published to the ValidateOrder Message Broker channel. In this part of the tutorial scenario, if the number of widgets requested is greater than 400, the Request for Quote is determined to be invalid and the ValidateOrder.java process publishes a message to a second Message Broker channel (named StopQuote). Your RequestQuote business process subscribes to the StopQuote Message Broker channel—when it receives the message from that channel, the RequestQuote business process is terminated.

The following figure outlines the flow of execution at run time for the RequestQuote business process you build in Part IV and the interaction with the ValidateOrder business process:

The interactions between the business processes via the Message Broker channels is indicated by the numbers in the figure. The following steps describe the flow:

  1. Your RequestQuote business process publishes the Request for Quote message to the ValidateOrder Message Broker channel.
  2. The ValidateOrder business process starts when it receives a message on the ValidateOrder channel to which it is subscribed.
  3. If the ValidateOrder business process determines that the order in the Request for Quote message is invalid, it publishes a message to the StopQuote Message Broker channel.
  4. The RequestQuote business process subscribes to the StopQuote Message Broker channel and receives the message from the channel on the onMessage path. A response is sent to the client from the Deny Quote node on the onMessage path, and the RequestQuote business process is terminated.

Proceed to the next topic to start the steps included in Part IV of the tutorial.


  Back to Top       Previous  Next