About the WebSphere Business Monitor sample

This sample demonstrates how you can emit events from WebSphere Message Broker and process the events in WebSphere Business Monitor. The sample describes the following tasks:

The sample shows how you can configure WebSphere Business Monitor to receive events from WebSphere Message Broker demonstrating:

The sample is based on the following scenario:

A gardening supplies company receives purchase order requests from three types of customer:

The purchase order requests that are received contain the items to order, but they do not include a total cost for the items ordered. The message flow calculates this total and also gives a 15% discount to gold customers. The gold customer orders are also handled by a different service application, therefore the message flow routes the order depending on the customer type.

TotalPurchaseOrderFlow message flow

TotalPurchaseOrderFlow

The WebSphere MQ input queue INPUT_ORDER_PRICE receives the purchase order request. A Compute node, ComputeOrderTotal, is used to:

Depending on the customer type, the output request is sent to one of the following WebSphere MQ output queues:

The message set project, WBMonitorEventsMessageSet, contains the message definitions for the input and output messages.

The input message takes the form:

<?xml version="1.0" encoding="UTF-8"?>
<PO:purchaseOrder xmlns:PO="http://www.ibm.com/ProcessOrder" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/ProcessOrder totalPOInstance.xsd ">
  <PO:purchaseOrderID>11112222</PO:purchaseOrderID>
  <PO:customerID>111111</PO:customerID>
  <PO:customerType>GOLD</PO:customerType>
  <PO:items>
    <PO:item>
      <PO:partNum>0239232</PO:partNum>
      <PO:productName>compost</PO:productName>
      <PO:quantity>14</PO:quantity>
      <PO:price>4.99</PO:price>
    </PO:item>
    <PO:item>
      <PO:partNum>0451481</PO:partNum>
      <PO:productName>lawnmower</PO:productName>
      <PO:quantity>10</PO:quantity>
      <PO:price>79.99</PO:price>
    </PO:item>
    <PO:item>
      <PO:partNum>0481257</PO:partNum>
      <PO:productName>spade</PO:productName>
      <PO:quantity>10</PO:quantity>
      <PO:price>19.99</PO:price>
    </PO:item>
  </PO:items>
</PO:purchaseOrder>

The output message takes the form:

<?xml version="1.0" encoding="UTF-8"?>
<PO:purchaseOrderPriced xmlns:PO="http://www.ibm.com/ProcessOrder" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/ProcessOrder totalPOInstance.xsd ">
  <PO:purchaseOrderID>11112222</PO:purchaseOrderID>
  <PO:customerID>111111</PO:customerID>
  <PO:customerType>GOLD</PO:customerType>
  <PO:items>
    <PO:item>
      <PO:partNum>0239232</PO:partNum>
      <PO:productName>compost</PO:productName>
      <PO:quantity>14</PO:quantity>
      <PO:price>4.99</PO:price>
    </PO:item>
    <PO:item>
      <PO:partNum>0451481</PO:partNum>
      <PO:productName>lawnmower</PO:productName>
      <PO:quantity>10</PO:quantity>
      <PO:price>79.99</PO:price>
    </PO:item>
    <PO:item>
      <PO:partNum>0481257</PO:partNum>
      <PO:productName>spade</PO:productName>
      <PO:quantity>10</PO:quantity>
      <PO:price>19.99</PO:price>
    </PO:item>
  </PO:items>
  <PO:priceSummary>
    <PO:itemTotal>1069.66</PO:itemTotal>
    <PO:deliveryCharges>19.99</PO:deliveryCharges>
    <PO:discount>163.44</PO:discount>
    <PO:invoice>926.21</PO:invoice>
  </PO:priceSummary>
</PO:purchaseOrderPriced>  

Notice that the root element name on the output message has been changed by the Compute node to purchaseOrderPriced.

Monitoring is configured in the following nodes in the flow:

To view details for any of the nodes, open the Message Flow editor and select the Monitoring tab. Guest orders are not monitored by WebSphere Business Monitor, therefore, an event filter has been configured so that events from guest customers are not emitted.

Monitor models

A sample monitor model, created by using the export monitoring information option, is contained in the MonitorModels_V7.zip file, WBMonitorEventsV7_Model.mm

The following three sample monitor models are contained in the MonitorModels.zip file:

FlowGeneric monitor model

This model is a generic model that you can use to view message flow start, end, and rollback events from any flow that is running on any execution group. The model contains metrics that hold information from the event. The key performance indicators (KPIs) show the flow processing time, the number of active, completed (including successful and failed transactions), failed, and successful transactions.

FlowSpecific monitor model

This model enables you to view the events for a specific flow that is running in a specific execution group on a specific broker, which is achieved by creating a filter in the monitor model. The filter is set by using an XPath expression when the inbound event details are defined in the monitor model. Like the FlowGeneric model, some of the metrics that contain information from the event have already been defined. Filter conditions are set up to filter the events on the broker, execution group, and message flow that are used in this sample. You can use the Monitor Model Editor (MME) in the WebSphere Business Monitor Development Toolkit to change the inbound event filter to any other broker, execution group, or message flow, or you can choose to filter on another metric.

ComplexContent monitor model

This model is used in the remainder of the sample. Like the FlowSpecific model this model filters on broker, execution group, and message flow name, but this sample model also creates metrics that use trigger expressions to populate the WebSphere Business Monitor outbound event with the following elements from the message payload:

You can use MME to change the event parts of the WebSphere Business Monitor inbound events FlowStarted and FlowPriceSummary to extract other payload fields.

A KPI model is created that contains a KPI context. The KPI context contains the KPIs defined for the model and their associated triggers and events. You can view these triggers and events from the KPI Model page in the MME. Some of the KPIs that are created are:


WBMonitorEventsV7_Model monitor model

This model is a version of the ComplexContent monitor model, which has been created by using the option in the workbench to export monitoring information about the sample message flow.

To find out how to create a monitor model application from the model, and a dashboard based on the model, see Running the WebSphere Business Monitor sample.

For more information about creating a monitor model in WebSphere Business Monitor, see This link opens in a new window IBM WebSphere Business Process Management Information Center.

Back to sample home