Business Event Processing with WebSphere Business Events, Part 5: Integrating Business Events with WebSphere Business Monitor

In Part 5 of this series, you'll learn about the support provided in WebSphere® Business Events V6.1 for integration with WebSphere Business Monitor. You'll learn how to configure WebSphere Business Events so that it can forward business events in a format that WebSphere Business Monitor can process, and how the Monitor dashboards can help you monitor and react to these events.


Latha Sivakumar (, Advisory Software Engineer, IBM

Latha Sivakumar photoLatha Sivakumar is an Advisory Software Engineer with the IBM WebSphere Business Monitor development team in Research Triangle Park, NC. She currently works on integration of Business Monitor with other products in the BPM suite, including Websphere Business Events. She previously worked on the Monitor Data Services team and on multiple Tivoli products, including Tivoli Business System Manager. You can reach Latha at

15 March 2010 (First published 15 December 2008)

Also available in Chinese Japanese Spanish


Part 1 of this series introduced you to the trade system scenario that is used throughout this series. In Part 2, you built and tested the trade system application. This article uses the project for the trade system scenario introduced in Part 2, which guides you through the process of defining and deploying the Trade system scenario artifacts. In order to understand this article, you should have read and completed the steps in Parts 1 and 2.

In this article, you'll learn how to generate an Action event that is pushed from WebSphere Business Events (hereafter called Business Events) to a Common Event Infrastructure (CEI) server, which distributes events to WebSphere Business Monitor (Monitor). You'll also learn how to export the event schema from Business Events so that it can be used in authoring a monitor model that is deployed on the Monitor server to analyze the event data and display the it on the Monitor dashboard.

Overview of WebSphere Business Monitor

WebSphere Business Monitor is business-activity monitoring (BAM) software that is capable of monitoring business applications running almost anywhere, as long as they can generate Common Base Events (CBEs) from their activity. These applications must be able to generate a series of events, which encapsulate the business data, and forward them to the common event infrastructure (CEI). CEI is IBM's implementation of a consistent approach for the creation, transmission, persistence and distribution of a wide range of business, system and network events, based on common base events. Monitor uses CEI to receive events from applications. The content and format of the events forwarded to Monitor determine how easy it is for customers to author monitor models and monitor meaningful business data.

To monitor events from Business Events, you must create a monitor model using the WebSphere Business Monitor Development Toolkit. A monitor model is an XML document that describes how to gather business data from incoming events, group them around the same entity and provide a context. It also describes metrics and key performance indicators (KPIs), their dependencies on incoming events, conditions warranting business actions, and outbound events that report such conditions and might trigger business actions.

The model can also structure the data and persist it for dimensional analysis, or to identify trends. You can visualize data using annotated diagrams.

Once the monitor model is created and deployed on the Monitor server, it begins processing events from sources such as WebSphere Business Events, according to the definitions in the monitor model logic. For more information about event sources that forward events to Monitor, refer to Business Activity Monitoring with WebSphere Business Monitor V6.1. Chapter 1 provides an overview of CEI, an embeddable technology that provides basic event management services for WebSphere Business Monitor.

Install and configure Business Events and Monitor

The sample that accompanies this article was developed and tested using a Windows 2003 system on which Business Events V6.1 was installed. Business Events V6.1 also installed WebSphere Application Server (Application Server) V6.1.0.15. The CEI server was enabled on Application Server. Refer to the Application Server V6.1.1 Information Center for instructions on enabling CEI.

Monitor was installed on a different Windows XP system, and the Monitor server was configured to receive CEI events from the remote CEI server enabled with the Business Events installation. In order to do this, you need to install the cross-cell files, create the remote service integration bus, and create the link between the local and remote buses. The cross-cell files are required to support a remote CEI server on Application Server V6.1. The events generated by Business Events were distributed to the remote CEI server and processed by the Monitor model.

In order to set up a cross-cell configuration to a remote CEI system, follow the instructions in the Remote CEI on WebSphere Application Server 6.1 topic in the Monitor Information Center.

You can also install Business Events and Monitor on a single system and have then running in the same Java™ Virtual Machine (JVM). Doing this eliminates the need for the remote CEI configuration. To install Business Events V6.1 and Monitor V6.1.2 on the same server follow these steps:

  1. Install Business Events V6.1 with Application Server V6.1.0.15 and DB2® 9.5.
  2. Upgrade Application Server V6.1.0.15 to Application Server V6.1.0.17, if you are using Application Server V6.1.2.
  3. Install the Monitor V6.1.2 production version.
  4. Use the Profile Management Tool to augment the profile created during Business Events installation with the Business Monitor template.
  5. Make sure to install the Monitor Toolkit that is at the same level as the Monitor server in order to use the monitor model provided with this article.

Note: The CEI server is enabled during Business Monitor installation and does not have to be enabled separately.

For more information installation, see the Installation and Operation Guide in the Business Events V6.1 Information Center and the Installing WebSphere Business Monitor topic in the Monitor V6.1 Information Center.

Send Business Events actions to Monitor

You can import the sample trade application project provided with this article, which is based on the scenario described in Part 2, into Business Events Design Data.

The integration scenario

As described in previous parts in this series, the scenario is based on a trading system in which a Business Events application processes buy and sell events. In the trade system scenario, Business Events receives Sell and Buy events that have attributes describing the customer, stock, the date and time when the trade took place, the number of shares, and the price. Policies are defined to detect patterns in these events. When a Sell occurs after a Buy event within an hour for the same stock and the same customer, a SellAfterBuy action is generated. This action is pushed out to a touchpoint--in this case Monitor. If one customer completes three sells after buys within a day, for the same or different stocks, a SpeculativeCustomer action is generated and pushed out to the touchpoint, Monitor. These actions are outbound events from Business Events to Monitor. The embedded message queue connector provides the connection from Business Events to the CEI server that distributes events to Monitor, and it sends a correctly configured Action packet to the specified CEI JMS queue. Figure 1 illustrates the connection from Business Events to Monitor using the message queue connector.

Figure 1. Embedded Message Queue Connector
Embedded Message Queue Connector

Monitor captures business-related data in the incoming Common Base events such as stock ID, quantity and price, and transforms the variables into metric and KPI values. It can display the KPI that measures the number of SellAfterBuys that occur in a week and send alerts if such activities exceed a set threshold. The SellAfterBuy KPI can be set up for different regions of a country, can be displayed on a dashboard in different formats for these different regions, and can send alerts when a threshold is exceeded to warn of suspicious trading patterns.

A sample project for a Trade System application is provided with this article, in which the touchpoints, events, actions, intermediate objects, and message queue connectors are already defined. In You'll learn how this project was defined to send action events to Monitor.

Import the sample project

Save the sample project, tradesystem.xml, to a folder on your hard drive. Complete the following steps. Refer to the Business Events Information Center if you need help navigating the tools.

  1. Open the Design Data tool.
  2. Select File => Open Project, as shown in Figure 2.
    Figure 2. Import sample project
    Import sample project
  3. Click Browse, select the sample project and click Open.

Design Data now contains the sample Trade System project.

Define the actions

Once you've imported the tradesystem.xml project file, you'll see that the Touchpoint pane is populated with a number of entries. The Business Events actions that will be forwarded to Monitor are defined in this Touchpoints pane.

To see how these actions are defined, do the following:

  1. Right-click Sell After Buy and select Action Properties.
    Figure 3. Modify action properties
    Modify action properties
  2. Select the Connection tab and clickMessage Queue Connection , as shown in Figure 4.
    Figure 4. Message Queue Connection
    Message Queue Connection
  3. Click Configure.
  4. The Common Event Infrastructure (CEI) supports the direct placement of a properly formatted CBE XML on its input queue without using their emission APIs. This allows any Application Server-based application like Business Events to easily route events to the CEI queues. In order for this action to generate CBE XMLs that will be forwarded to CEI, you need to specify the following in the Message Queue Action Connection dialog, as shown in Figure 5:
    • Format: CBE (WBM)
    • Queue Type: JMS Queue
    • Queue Name: jms/cei/EventQueue
    Then click the Provider button.
    Figure 5. Message Queue Action Configuration
    Message Queue Action Configuration
  5. In the Provider dialog, enter the following information, as shown in Figure 6:
    • Context Factory Class:
    • URL: iiop://<server>:<port>. To get the port value, open the Application Server administrative console and find the CEI server Application Server bootstrap port address. For the sample, the URL is iiop://localhost:2809.
    • Factory Name: jms/cei/EventQueueConnectionFactory
    • Username: Enter a valid user name if JMS requires a user ID and password.
    • Password: Enter a password associated with the user name if JMS requires a user ID and password
    Figure 6. Provider Configuration
    Provider Configuration
  6. Repeat these same steps for the Speculative Customer action.

Export the schema for the actions

When the actions are forwarded to the CEI server, Monitor can process them. However, you must first create and deploy a monitor model on the Monitor server. To create the monitor model, you first need to export the schemas of the Sell After Buy and Speculative Customer actions from Business Events.

Note: A sample monitor model with exported schema is provided for download with this article. You can use the following steps to export other schemas for inclusion in your monitor model. In this article, we won't walk through all the steps of authoring a monitor model. Refer to the Monitor Information Center for more information on this topic.

To export the schema, complete the following steps:

  1. Open the sample Trade System project.
  2. In the Touchpoint pane, right-click Sell After Buy and select Action Properties.
  3. Select the Action tab, as shown in Figure 7, and click Export packets and schemas, then select CBE Payload Schema.
    Figure 7. Export SellAfterBuy schema
    Export SellAfterBuy schema
  4. Enter the host portion of the target namespace for this schema, as shown in Figure 8, then click OK. This value must match the value of the Business Events system name. Otherwise, it will result in a mismatch between the generated target namespace in the schema and the namespace specified in the generated CBE XML.
    Figure 8. Specify the target nameSpace
    Specify the target nameSpace
  5. Save the SellAfterBuy.xsd file.
  6. Also export the CBE Example for later reference. Repeat Steps 3 and 4, selecting CBE Example in Step 3. Listing 1 shows the sample. Notice the target namespace in bold.
Listing 1. CBE example for Sell After Buy action
      <wbe:name>Sell After Buy</wbe:name>
	Test values from WebSphere Business Events:Design Data
      <wbe:name>Sell After Buy</wbe:name>
      <wbe:payload name="Trade Out">
        <payload:Trade-Out-array xmlns:payload=

Import the monitor model into the Monitor Toolkit

A project interchange file,, with a simple monitor model is provided for download with this article. Once you've Installed the Monitor Toolkit, which must be at the same level as the Monitor server, import the project file into the Monitor Model editor. For more information, refer to Importing shared projects in the Monitor Information Center.

  1. Start WebSphere Integration Developer or Rational Application Developer and specify a new workspace, for example: c:\TradeSystem.
  2. Open the Business Monitoring perspective.
  3. To import the provided project interchange file,, select File=> Import => Other =>Project Interchange File. Browse to the file, and click Finish, as shown in Figure 9.
    Figure 9. Import the project interchange file
    Import the project interchange file
  4. Expand the TradeSystem project in the Project Explorer pane to view the parts of the monitoring model.

Define events

Open the TradeSysten project and examine the imported schema events. There are two schemas that are specific to Business Events:

  • WBEEvent.xsd describes the static content of a Business Events action that is the same for every action. This xsd file is static and is not exported from Business Events.
  • SellAfterBuy.xsd: describes the SellAfterBuy action in a format that can be consumed by Monitor. This is dynamic content that varies and is often called the business payload.

Together, the two schema definitions define the Business Events action that flows in the xs:any slot of the Common Base Event.

Note: The SellAfterBuy.xsd was exported from Business Events and the host portion of the target namespace specified in this schema file may not match your Business Events system name. You need to modify the SellAfterBuy schema file, shown in Listing 2, in the monitor model to match your Business Events system name, as described in the following steps.

  1. Open the SellAfterBuy.xsd in the Monitor Model editor. Replace all occurrences of host name LATHAZ with your Business Events system host name.
  2. In the SellAfterBuy.xsd, replace all occurrences of LATHAZ with your Business Events host name. Refer to Step 8 in Export the schema for the actions to determine the targetNamespace value.
Listing 2. SellAfterBuy schema file
<schema xmlns=""
  <element name="Trade-Out-array">
      <element maxOccurs="unbounded" minOccurs="0" 

Monitoring context

A Sales_MC monitoring context defines all of the related data that will be collected from the SellAfterBuy inbound event about a stock sale.

The inbound event defined in the monitoring context is SellAfterBuy. Two event parts are defined. One part, called EventInfo, describes the type of the static event information and another part, called TradeOutArray, describes the type of the dynamic business payload.

The business data flowing through the system determines the dynamic content in an event. This information is typed by user-defined XSDs available in WebSphere Integration Developer. Only certain events can contain this information, which is often called the business payload. When you're generating a monitor model from an application, these events are shown with a flag and package icon in the Monitor Model editor, while events that can never carry business information are shown with a flag icon.

When an inbound event is based on an event that carries a business payload, an event part that describes the type of the business payload is created in the inbound event in the monitor model. Listing 3 shows a snippet from the monitor model that defines the inbound event parts, filter condition and correlation expression.

Listing 3. Monitor model definitions example
Filter Condition: 
/* This expression accesses the name in the event-info 
within the CBE*/
SellAfterBuy/My_Event_Part/wbe:name = 'Sell After Buy'.  

Correlation Expression: 
/* This expression accesses  then Key in the Trade-Out 
element within the CBE */
StockIDKey = TradeEvent/My_Event_Part2/tns:Trade-Out/tns:Key

<inboundEvent displayName="TradeEvent" id="TradeEvent"
	  <eventPart displayName="My Event Part" id="My_Event_Part"
      	<eventPart displayName="My Event Part2" id="My_Event_Part2"
             wbe:payload[@name='Trade Out']/tns:Trade-Out-array" 
      	<correlationPredicate expression="StockIDKey =
      	<filter expression="TradeEvent/My_Event_Part/
		wbe:name = 'Sell After Buy' "/>

Refer to the InstalliMonitor Information Center for more information about importing the project file into the Monitor Model editor, and creating and deploying monitor models on the Monitor server. The provided model has a single monitoring context that subscribes to the SellAfterBuy event. It also defines one KPI that tracks the number of SellafterBuyEvents for the last 7 days. You can enhance the provided model, as desired.

Generate the monitor model EAR file

Complete the following steps to generate the monitor model EAR file from the provided project interchange file.

Note: You can use the EAR file provided for download with this article instead of generating your own.

  1. Right-click in the Project Explorer, and select Generate Monitor J2EE Projects, as shown in Figure 10.
    Figure 10. Generate Monitor J2EE projects
    Generate Monitor J2EE projects
  2. Click Finish in the Generate Monitor J2EE Projects dialog, shown in Figure 11, and wait for generation to complete.
    Figure 11. Generate EAR file
    Generate EAR file
  3. To export the monitor EAR file, right-click in the Project Explorer and select Export => J2EE => EAR, and click Next.
  4. Select the EAR application and the destination for the EAR file as shown in Figure 12, and click Finish.
    Figure 12. Specify information about EAR file
    Specify information about EAR file

Now you're ready to deploy the EAR file on the Monitor server.

Deploy the monitor model on the Monitor Server

Before deploying the EAR file, make sure the Monitor server is running, then start the administrative console for the Monitor server.

  1. From the Application Server administrative console, select Applications => Monitor Models. The table that is displayed lists all of the currently installed monitor models.
  2. Click Install.
  3. Specify the location of the EAR file you want to install, as shown in Figure 13.
    Figure 13. Deploy the EAR file on the server
    Deploy the EAR file on the server
  4. Select Show me all installation options and parameters, and click Next.
  5. On the Preparing for the Application Installation page, click Next.

    If an application security warning displays, click Continue. This warning is for informational purposes.

  6. The Install New Application page is displayed.

    Note: If you have configured a remote CEI server, you must modify the CEI options to specify the remote host name, RMI port and security settings. See the Select Monitor model CEI options in the Monitor Information Center.

  7. When you've finished any CEI modification needed, click Summary, and verify that all information is correct, as shown in Figure 14.
    Figure 14. Verify deployment information
    Verify deployment information
  8. To review the model installation information, click Review changes before saving or discarding, or to save the model, click Save directly to the master configuration.
  9. Select Applications => Monitor Models. Check to make sure that the TradeSystem model status is started--it should be green. If not, wait a few seconds or refresh the status by clicking on the refresh icon on the Status column.

For more information about deploying your monitor model on the Monitor server, refer to Installing a monitor model using modified settings in the Monitor Information Center.

Once you've completed all the steps to deploy the model and saved it to the Application server master configuration, you need to verify that the model has installed successfully. To do this, in the Application Server administrative console, click Applications => Monitor Models and make sure the model application is running.

Displaying the Instances and KPI views on the dashboard

To open the dashboard, point your Web browser to http://localhost:9080/BusinessSpace. The port number may be different on your system.

Use the BusinessSpace dashboard to import the dashboard,, provided with this article, so that you can see the KPI and Instances view.

To import a dashboard, complete the following steps:

  1. Go to the BusinessSpace Space Browser, as shown in Figure 15, and click Import Space.
    Figure 15. Import the dashboard
    mport the dashboard
  2. Browse to the directory that contains the file you want to import, as shown in Figure 16, 4. and select the data file,, that contains the dashboard that you want to import.
    Figure 16. Import
    Figure 16. Import
  3. Click OK. A new dashboard is created. The importer of the dashboard, in this case you, owns the imported dashboard.

You can now see the Instances view and the KPI Gauge.

The sample model does not explore all the available monitoring capabilities, but you can extend the model with more monitoring contexts, alerts, and reports.

You must now generate some events to see data in the dashboard.

Deploy your configuration and prepare for testing

To deploy your configuration in preparation for testing, complete the following steps:

  1. To deploy your Business Events changes, select Tools => Repositories in the Design Data tool, as shown in Figure 17.
    Figure 17. Open repository
    Open repository
  2. In the Repository window, select an element from the list of artifacts in the Project pane, then press Ctrl+A to select them all, and click Add in. All elements, including your changes, are added to the repository.
  3. Stop the Business Events runtime so that it can retrieve the latest configuration information from the repository.
  4. Open an Application Server administration console and log in.
  5. Select Enterprise Applications from the left column. You'll see the current state of the Business Events runtime, as shown in Figure 18. The green application status indicates that the application is running.
    Figure 18. Business Events runtime
    Business Events runtime
  6. Check WBERuntimeEar and click Stop.
  7. After the runtime stops and the status turns red, check WBERuntimeEar again and click Start. The runtime should soon show a green application status indicating that is has started.

Now we're ready to test the sample project.

Test your configuration

In order to forward actions to Monitor, you need to export the sample event packets to the c:\wbetmp\testdata directory. You may also use the provided sample aEvent_Buy.xml and bEvent_Sell.xml if you want to skip the steps to export the sample event packets.

  1. Right-click the Buy event in the Touchpoints pane and select Event Properties, as shown in Figure 19.
    Figure 19. Select Buy event properties
    Select Buy event properties
  2. In the Event Buy Properties dialog, select the Event tab.
  3. Click Export packets and schemas, then select WBE Events Packet Example, as shown in Figure 20.
    Figure 20. Export Buy event sample
    Export Buy event sample
  4. Save the file aEvent_Buy.xml to the c:\wbetmp\testdata directory and rename it aEvent_Buy.xml.
  5. Repeat these steps to save the sample Sell event, which is located below the Buy event in the DirectorData. Save the Sell sample to the c:\wbetmp\testdata directory and rename it bEvent_Sell.xml.
  6. When executing the sample project, make sure that all generated Buy events are saved with a prefix of "a" (for example, aEvent_Buy.xml) and all Sell events have a prefix of "b" (for example, bEvent_Sell.xml). The sample project has been configured to distinguish between the incoming Buy and Sell events based upon the prefix of the file. This allows the user to stagger the order in which events are processed and ensure that certain events are consumed before others.

    When a Buy event is followed by a Sell event within an hour for the same stock and the same customer, a SellAfterBuy action is generated. Therefore, we need to generate the Buy event first, followed by the Sell event.

  7. Save the Buy event file, and open it with an xml editor to examine the structure of the event payload. Listing 4 shows the Buy event XML file.
  8. Ensure that there are no nulls embedded at the end of the file.
Listing 4. Buy event XML file
<connector name="Trade System" version="2.2">
  <connector-bundle name="Buy" type="event">
    <connector-object name="Trade">
      <field name="CustomerID" type="String">String_CustomerID</field>
      <field name="StockID" type="String">String_StockID</field>
      <field name="Date" type="DateTime">2008-05-24T14:07:10Z</field>
      <field name="Quantity" type="Real">9.9</field>
      <field name="Price" type="Real">9.9</field>
  <loginfo>Test values from WebSphere Business Events:Design Data</loginfo>
  1. Edit all the event files and change the date fields in the events to the current date. Otherwise the monitor model will not calculate the values for the last 7 days.
  2. To start the connectors, go to the \director\bin directory, for example: C:\<wbe install>\director\bin, and run connectors.bat.

    This initiate the connectors, and opens a command window displaying the start-up and the scan for the event files you've created and saved to the Business Events event directory. You'll be able to see your events being processed by the connector in the command line window.

  3. Copy aEvent_Buy.xml from c:\wbetmp\testdata to c:\wbetmp. Wait a minute for the event to be consumed. You can watch for it in the connectors command window.
  4. Copy bEvent_Sell.xml from c:\wbetmp\testdata to c:\wbetmp. Wait a minute for the event to be consumed. You can watch for it in the connectors command window.
  5. The Buy and Sell events generate the SellAfterBuy Action event, as shown in Figure 21.
    Figure 21. Connectors
  6. Do the following to ensure that there are no problems with the processing:
    • Check to ensure that the events you have created and saved in the the c:\wbetemp\ event directory have been deleted.
    • Check the Application Server logs.
    • Check the Connector log, which is located at C:\<WBE INSTALL>\director\logs filename WBERuntime.connectors.log.

View the data in the Monitor dashboard and database

Open the BusinessSpace dashboard. You should be able to see one instance in the Instance view.

You should also be able to see data in the KPI views, when you hover over the KPIs. The gauge indicator should indicate one instance of SellAfterBuy, as shown in Figure 22.

Figure 22. Monitor dashboard with KPIs
Monitor dashboard with KPIs

You should also be able to see the data in the database. Use a tool, such as DB2 Control Center, to view the data. Look at the data in the monitor database, whose default name is MONITOR. Open the table MCT_SALES_MC_20080809010432. This table should contain one record that reflects the SellAfterBuyAction event that was received by Monitor, as shown in Figure 23.

Figure 23. Data in the Monitor database
Data in the Monitor database


In this article, you walked through the following steps required to forward events from WebSphere Business Events to WebSphere Business Monitor.

  1. Using the WebSphere Business Events Design Data tool, you:
    • Created an application with actions.
    • Configured these actions so that they will forward to Monitor (the touchpoint).
    • Exported the schemas for the defined actions to the file system/
  2. Imported the action schemas into the Monitor Model Toolkit editor to author monitor models.
  3. Deployed the monitor models using the WebSphere Application Server administrative console.
  4. Started the Business Events connectors process to start forwarding generated actions to Monitor.
  5. Viewed the action events received and processed by Monitor in the dashboard.

The integration of Business Events and Monitor allows you to take advantage business data analysis and reporting capabilities available with Monitor, and to use the KPIs and notification services provided by the Monitor Action Manager component.


Event packet and dashboardEventsAndDashboard.zip2KB
Business Events schemasEventsSchemas.zip2KB
Monitor model EAR fileTradesystemMonitoringModel.zip199KB
Project file for trade system apptradingsystem.zip3KB
Monitor model project interchangeTradeSystemPI.zip4KB



developerWorks: Sign in

Required fields are indicated with an asterisk (*).

Need an IBM ID?
Forgot your IBM ID?

Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.


All information submitted is secure.

Dig deeper into Business process management on developerWorks

Zone=Business process management, WebSphere
ArticleTitle=Business Event Processing with WebSphere Business Events, Part 5: Integrating Business Events with WebSphere Business Monitor