if (!existRules.isEmpty()) {
nav.redirectToLocation("alarmRuleList.htm?pipelineId=" + pipelineId);
return;
}
AlarmRule alarmRule = new AlarmRule();
alarmRule.setPipelineId(pipelineId);
alarmRule.setDescription("one key added!");
alarmRule.setAutoRecovery(Boolean.FALSE);
alarmRule.setReceiverKey("otterteam");
alarmRule.setStatus(AlarmRuleStatus.DISABLE);
alarmRule.setRecoveryThresold(3);
alarmRule.setIntervalTime(1800L);
try {
alarmRule.setMonitorName(MonitorName.EXCEPTION);
alarmRule.setMatchValue("ERROR,EXCEPTION");
alarmRule.setIntervalTime(1800L);
alarmRule.setAutoRecovery(false);
alarmRule.setRecoveryThresold(2);
alarmRuleService.create(alarmRule);
alarmRule.setMonitorName(MonitorName.POSITIONTIMEOUT);
alarmRule.setMatchValue("1800");
alarmRule.setIntervalTime(1800L);
alarmRule.setAutoRecovery(true);
alarmRule.setRecoveryThresold(0);
alarmRuleService.create(alarmRule);
alarmRule.setMonitorName(MonitorName.DELAYTIME);
alarmRule.setMatchValue("1800");
alarmRule.setIntervalTime(1800L);
alarmRule.setAutoRecovery(false);
alarmRule.setRecoveryThresold(2);
alarmRuleService.create(alarmRule);
alarmRule.setMonitorName(MonitorName.PROCESSTIMEOUT);
alarmRule.setMatchValue("60");
alarmRule.setIntervalTime(1800L);
alarmRule.setAutoRecovery(true);
alarmRule.setRecoveryThresold(2);
alarmRuleService.create(alarmRule);
// alarmRule.setMonitorName(MonitorName.PIPELINETIMEOUT);
// alarmRule.setMatchValue("43200");
// alarmRuleService.create(alarmRule);
} catch (Exception e) {