Chapter 18. Polling for events 299
// Update the event status to ERROR_PROCESSING_EVENT
evts.updateEventStatus(
evtObj,
CWConnectorEventStatusConstants
.ERROR_PROCESSING_EVENT);
if (arcProcessed
.equalsIgnoreCase(CWConnectorAttrType.TRUESTRING)) {
// Archive the event in the application’s archive store
evts.archiveEvent(evtObj.getEventID());
// Delete the event from the event store
evts.deleteEvent(evtObj.getEventID());
}
continue;
}
// Check again for subscription.
if (isSubscribed(bo.getName(), bo.getVerb())) {
// Send the event to integration broker.
int stat = gotApplEvent(bo);
if (stat == CWConnectorConstant.CONNECTOR_NOT_ACTIVE) {
CWConnectorUtil.generateAndTraceMsg(
CWConnectorLogAndTrace.LEVEL3,
10551,
CWConnectorLogAndTrace.XRD_INFO,
0,
0);
evts.updateEventStatus(
evtObj,
CWConnectorEventStatusConstants.READY_FOR_ROLL);
// No need to archive the event, as the status is reset
// to READY_FOR_POLL. It is as if this event never
//reached the
// connector for processing.
return CWConnectorConstant.SUCCEED;
}
if (stat
== CWConnectorConstant.NO_SUBSCRIPTION_FOUND) {
CWConnectorUtil.generateAndLogMsg(
10552,
CWConnectorLogAndTrace.XRD_ERROR,
0,
0);
// Update the event status to UNSUBSCRIBED.
evts.updateEventStatus(
evtObj,
CWConnectorEventStatusConstants.UNSUBSCRIBED);
if (arcProcessed
.equalsIgnoreCase(
CWConnectorAttrType.TRUESTRING)) {
// Archive the event in the application’s archive