@Action("attachAlert")
public void onAttachAlert() {
try {
if (ruleAlertRelations == null || ruleAlertRelations.isEmpty()) {
RuleAlertRelation ruleAlertRelation = RuleAlertRelation.newRuleAlertRelation(ruleId, alertId, maxConsecutiveFailCount);
ruleAlertRelationDao.insert(ruleAlertRelation);
put("success", true);
addMessage($("Alert has been attached."), Noty.Type.SUCCESS);
} else {