Skip to main content

BPM voices: Joachim Frank: Behind the scenes of WebSphere Business Monitor event processing

Joachim (Jim) H. Frank (jhfrank@us.ibm.com), Senior Software Architect, IBM
Joachim (Jim) Frank photo
Joachim (Jim) H. Frank is a Senior Software Architect with IBM. He provided technical leadership for the design and development of WebSphere Business Modeler and WebSphere Business Monitor. You can reach Jim at jhfrank@us.ibm.com.

Summary:  Confused by how event processing works in WebSphere® Business Monitor? Just what are filter expressions, correlation predicates, and monitoring contexts, and how do they cooperate to ensure that the right events update the correct metrics, so that your business can react quickly? In this article, Joachim Frank peels back the curtain to show you what's going on behind the scenes and how it all comes together to ensure your business gets the information it needs, where and when it needs it. This content is part of the IBM Business Process Management Journal.

Date:  04 Dec 2008
Level:  Introductory
Activity:  336 views

Users of WebSphere Business Monitor (Monitor) sometimes tell us that its event processing algorithm is difficult to grasp. Mostly they seem puzzled by the purpose of filter expressions and correlation predicates, by the various event delivery options, and by the way in which updates are driven in a monitoring context.

In this article, I'll give you a behind the scenes look at these concepts. I won't go over many of the finer points of the Monitor programming model like triggers, timers, and nested monitoring contexts, but will focus simply on the basics of event processing.

I've also provided a simple slide show for download that shows, through a simple storyline, the path an event takes as it's processed by Monitor.

Event processing concepts

At the core of Monitor are observer objects. One observer object is created for each entity you want to monitor. Monitored entities can be tangible, such as a device, server, or vehicle, or abstract, such as process execution or sales performance. The observer object subscribes to events that report any state changes in the monitored entity, and then updates its own state based on information in those events.

An Monitor observer object is called a monitoring context or MC because the information it collects provides the context for monitoring a specific entity. The data fields in an MC are called metrics because they typically represent measurements of business-relevant information.

For example, let's say a limo company wants to monitor its fleet of cars. The company might allocate an MC for each trip when it begins. This context can be updated with information, such as passenger pick-up time, traffic jams, and passenger drop-off time, based on events received from limos on the road. An MC for a trip might contain metrics for trip duration, pick-up and drop-off delays, a customer satisfaction index derived from these metrics, average driving speed, and so on.

Extending their monitoring capabilities, the limo company might create MCs for their drivers with metrics for things like punctuality, trips per month, average customer satisfaction, or create MCs for the cars, with metrics like gas mileage, next scheduled service, and so on. These MCs would be the observer objects for the drivers and the vehicles..

The metrics and event subscriptions of an MC are defined by monitoring context definitions. Just as an MC is a special-purpose object, its definition is a special-purpose class which defines the structure and behavior of its instances.

Now that you understand the basic concepts and terminology, let's see how it all works.


Event processing step-by-step

There are three steps to processing an event:

  1. Filtering - What kind of event is this?
  2. Correlation - Which MCs are interested in this event?
  3. Updating the MC - Which metrics are updated by the event, and how?

Each MC subscribes only to certain kinds of events.

For example, in the limo company, the trip MCs might subscribe to events that report trip dispatching, passenger pick-up, passenger drop-off, heavy traffic, and car incidents. The trip MC definition would need to define five event subscriptions, one for each kind of event.

An event subscription contains a filter, which is a Boolean expression that evaluates to true for events it subscribes to and to false for all other events. The only rule for defining a filter is that it must let events of the desired kind pass and block all others. For performance reasons, filters should be kept as small as possible, in other words, they should be just complex enough to identify a particular kind of event reliably among the variety of expected events.

If a subscribed event contains an xsi:type attribute identifying its payload, and events for different occurrences have different types, testing this attribute may be all that's needed. If, on the other hand, a generic event is used to report occurrences of different kinds, which can only be determined by examining further event content, the filter must test additional fields.

In the limousine example, if the cars report trip status using an event whose payload type is always limo:Trip (where limo represents a namespace) and dispatch, pick-up, and drop-off events are distinguished using an event nature field, the event nature field will need to be tested along with the xsi:type attribute to determine what kind of event has arrived.

After an event has passed a subscription's filter, the subscription's correlation predicate is evaluated for each instance of the MC definition. Correlation predicates typically compare some key value in the event , such as a unique trip identifier, with a metric containing the same key. If a matching MC is found, that MC may receive the event for further processing. If not, a new MC context may be created.

But what if that's not what you want? Say, for example, a passenger pick-up event arrives and no matching MC is found. In this case, you might not want to create a new MC, but instead raise an error condition indicating that the "car dispatched" event (which should have occurred first and created the MC) was not received. Similarly, if a "car dispatched" event arrives and correlation processing finds a matching MC, this indicates that a "car dispatched" event for the same trip has already been received. Again this represents an error, and delivering the duplicate dispatch event to the already existing context would not be what you'd want.

As you can see, it's important to be able control the event correlation algorithm. You can do this by configuring event delivery settings. Each event subscription has three settings, which cover the cases of zero, one, and multiple MCs fulfilling the correlation predicate.

The table below shows all possible event delivery settings.


Event delivery settings
Zero matchesOne matchMultiple matches
Ignore Ignore Ignore
Treat as error Treat as error Treat as error
Create new MC Deliver to the (single) matching MC Deliver to any matching MC
Roll back all changes and retry processing this event later Deliver to all matching MCs

After correlation processing has identified the MCs for event delivery, the event updates those MCs.

To understand how that works, you can think of an MC as a spreadsheet, whose cells represent the metrics. For each metric, the MC definition defines one or more maps that update its value. The maps are like spreadsheet formulas. A map may depend on no more than one vent subscription, and potentially on other metrics

When an event is delivered to an MC, all maps that depend on that event are run automatically, and their target metrics are updated with the results. Further updates are then processed in a cascading fashion, just like in a spreadsheet: maps that depend on the updated metrics are run, then maps that depend on their targets, and so forth. The cascade must terminate because the dependency graph defined by the maps is not allowed to have cycles. For example, if metric B depends on metric A, then metric A must not depend on metric B.


View the slide show

If you're still having a little trouble with some of the concepts, or you'd simply like an entertaining visual review of how the process works, take a look at the "Event processing" slide show provided with this article. This slide show steps you through the process I described in this article using simple graphics and an easy-to-understand story line.


Summary

I hope this article and the accompanying slides have given you a better understanding of the concepts behind event processing in WebSphere Business Monitor, as well as a clearer picture of how events are actually processed in a real-world scenario.



Download

DescriptionNameSizeDownload method
Slide show demoepdemo.pdf299KBHTTP

Information about download methods          Get Adobe® Reader®


Resources

About the author

Joachim (Jim) Frank photo

Joachim (Jim) H. Frank is a Senior Software Architect with IBM. He provided technical leadership for the design and development of WebSphere Business Modeler and WebSphere Business Monitor. You can reach Jim at jhfrank@us.ibm.com.

Comments (Undergoing maintenance)



Trademarks  |  My developerWorks terms and conditions

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere, SOA and Web services
ArticleID=356396
ArticleTitle=BPM voices: Joachim Frank: Behind the scenes of WebSphere Business Monitor event processing
publish-date=12042008
author1-email=jhfrank@us.ibm.com
author1-email-cc=crothemi@us.ibm.com

My developerWorks community

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Rate a product. Write a review.

Special offers