+ List<RuleResult4API> deployedRules = null;
+ boolean isRuleQueryAvailable = true;
+
+ try {
+ deployedRules = getExistingRules();
+ } catch (Exception e) {
+ LOGGER.warn("Failed to get existing rules for comparison.", e);
+ isRuleQueryAvailable = false;
+ }
+
+ // If it fails to load rule through API, it means that something must be wrong with the
+ // holmes-rule-mgmt service. Hence, there's no need to go on with remaining steps.
+ if (!isRuleQueryAvailable) {
+ return;
+ }
+
+ for (RuleResult4API ruleResult4API : deployedRules) {
+ configInEffect.put(ruleResult4API.getLoopControlName(), ruleResult4API.getContent());
+ }
+