Events can be queried by association types.
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.
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);