} else if (alertConditionCategory == AlertConditionCategory.EVENT) {
AlertConditionEventCategoryComposite eventComposite = (AlertConditionEventCategoryComposite) composite;
EventSeverity eventSeverity = EventSeverity.valueOf(alertCondition.getName());
String eventDetails = alertCondition.getOption();
EventCacheElement cacheElement = null;
try {
if (eventDetails == null) {
cacheElement = new EventCacheElement(alertConditionOperator, eventSeverity, alertConditionId);
} else {
String regexEventDetails = "", regexSourceLocation = "";
if (eventDetails.contains(AlertCondition.ADHOC_SEPARATOR)) {
String[] regexes = eventDetails.split(AlertCondition.ADHOC_SEPARATOR);
if (regexes.length > 0) {
regexEventDetails = regexes[0];
if (regexes.length > 1) {
regexSourceLocation = regexes[1];
}
}
} else {
regexEventDetails = eventDetails; // let's keep backward compatibility here, because there may be REST
// clients using the old approach
}
cacheElement = new EventCacheElement(alertConditionOperator, eventDetails, regexEventDetails,
regexSourceLocation, eventSeverity, alertConditionId);
}
} catch (InvalidCacheElementException icee) {
log.info("Failed to create EventCacheElement with parameters: "
+ AlertConditionCacheUtils.getCacheElementErrorString(alertConditionId, alertConditionOperator,