queryFailedEvents()

This method queries the failed event database to locate any events that meet the selection criteria.

Syntax

queryFailedEvents (EventQueryDef[] queryOptions, String startDateTime, 
      String endDateTime, int eventStatus, int maxrows)

Parameters

queryOptions
An array of selection criteria with the following format:

nameConnector
Name of the connector of interest.

nameCollaboration
Name of collaboration of interest.

nameBusObj
Name of the business object of interest.

verb
name of the verb of interest. If left null, all verbs will be selected.

startDateTime
The earliest date and time at which the event occurred. The format of the time is MONTH DD YYYY HH24:MI:SS.

endDateTime
The latest date and time at which the event occurred. The format of the time is MONTH DD YYYY HH24:MI:SS.
Note:
HH24 indicates hours in 24-hour format.

eventStatus
An integer that indicates the status of the event which can be one of the following:

STATUS_ANY_UNRESOLVED

STATUS_FAILED

STATUS_DEFERRED_RECOVERY

STATUS_SERVICECALL_IN_TRANSIT

STATUS_DELIVER_POSSIBLE_DUPLICATE

STATUS_SERVICECALL_WAITING

STATUS_USER_GENERATED

maxrows
Maxrows limits the number of elements returned by the method. If this parameter is omitted or set to zero, there is no limit to the number of elements returned.

The results returned is dependant on both the eventStatus and how you specify the time. Table 81 shows the what various time parameters will return in the results.

Table 81. Results for queryFailedEvents based on time parameters

startDateTime endDateTime Results
Not null Not null All events that meet the eventStatus that occurred between startDateTime and endDateTime
Null Not null All events that meet the eventStatus that occurred before endDateTime
Not null Null All events that meet the eventStatus that occurred after startDateTime
Not null Not null All events that meet the eventStatus regardless of time.

Returns

An array of failed events, FailedEventInfo, each element having the following structure:

nameOwner
NameOwner is the name of the collaboration to which this event belongs.

nameConnector
NameConnector is the name of the connector to which this event belongs.

nameBusObj
NameBusObj is the name of the business object involved in this event.

nameVerb
NameVerb is the verb executing during this event.

strTime
StrTime is the time of the event.

strMessage
strMessage is a message associated with the failing event.

wipIndex
wipIndex is an integer that indicates the event's position.

EventKeyAttrDef[]
An array that consists of nkeys elements of pairs of event attributes. The array has the following structure:

keyName
KeyName is the attribute name.

keyValue
KeyValue is the attribute value.

nkeys
NKeys is the number of key attributes in the EventKeyAttrDef array.

eventStatus
EventStatus is an integer that indicates the status of the event which can be one of the following:

STATUS_ANY_UNRESOLVED

STATUS_FAILED

STATUS_DEFERRED_RECOVERY

STATUS_SERVICECALL_IN_TRANSIT

STATUS_DELIVER_POSSIBLE_DUPLICATE

STATUS_SERVICECALL_WAITING

STATUS_USER_GENERATED

expirationTime
ExpirationTime is the time at which the event expires for a Long-Lived Business Process (LLBP).

scenarioName
ScenarioName is the name of the scenario occurring at the time of the event.

scenarioState
ScenarioState is the completion state of the running scenario.

Examples

The following example queries for all events that match the status STATUS_USER_GENERATED.

// Set up to query the failed events of a specific type for the collaboration.
EventQueryDef queryOption = new EventQueryDef();
// set query condition of busobj name
queryOption.nameBusObj = "TestBO";
// set query condition of connector name
queryOption.nameConnector = "SourceConnector";
// define query condition array
EventQueryDef[] queryOptions = new EventQueryDef[1];
queryOptions[0] = queryOption;
// query failed events with status of user_generated, no time 
// limitation
FailedEventInfo[] resultArray = queryFailedEvents(queryOptions, 
            "", "", FailedEventInfo.STATUS_USER_GENERATED);

// get the query result
for (int i = 0; i < resultArray.length; i++) {
 String busObjName = resultArray[i].nameBusObj;
 logInfo(busObjName + " failed");
 }

See also

Copyright IBM Corp. 1997, 2004