WebSphere WebSphere Enterprise Service Bus, Version 6.0.1 Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Querying events by association type

Events can be queried by association types.

Why and when to perform this task

The Common Base Event specification defines properties that establish relationships between events. The associatedEvents property is a complex element that contains one or more subelements of the AssociatedEvent type, each representing an associated event. Each AssociatedEvent element, contains subelements that identify the type of association and the application that established the association. Examples of association types might include CausedBy or Correlated.

By specifying the global instance identifier of a known event and a type of association, you can retrieve events that satisfy the specified association. To query events by association type, use the EventAccess.queryEventsByAssocation(String, String) method.

Steps for this task

  1. Optional: Create an event access bean.
  2. Call the EventAccess.queryEventsByAssociation(String, String) method.
    CommonBaseEvent[] events = eventAccess.queryEventsByAssocation(associationType,
                                                                   eventId);
    The parameters of this method are as follows:
    associationType
    The type of association. This is the name of an association type specified by the associationEngineInfo property.
    eventId
    The global instance identifier of a known event.

    The returned object is an array that contains the events that satisfy the specified type of association with the known event. Only events that are still in the event database at the time of the query are returned (an associated event might be purged from the database).

Example

The following code fragment returns all of the events from the event database that have a CausedBy association with a known event:

String eventId = causeEvent.getGlobalInstanceId();
CommonBaseEvent[] resultEvents = eventAccess.queryEventsByAssociation("CausedBy",
                                                                      eventId);

Task topic

Terms of Use | Rate this page

Timestamp iconLast updated: 13 Dec 2005
http://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/index.jsp?topic=/com.ibm.websphere.wesb.doc\doc\tcei_adminCBEB_queryByAssociation.html

(C) Copyright IBM Corporation 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)