we don't know if the rule has been deleted async. (#877)

Signed-off-by: Markus Rathgeb <maggu2810@gmail.com>
This commit is contained in:
Markus Rathgeb 2019-06-20 21:21:41 +02:00 committed by Kai Kreuzer
parent be40b7a1e8
commit f1dfb553c7

View File

@ -989,12 +989,14 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener<Modul
setTriggerOutputs(ruleUID, td);
final WrappedRule rule = managedRules.get(ruleUID);
boolean isSatisfied = calculateConditions(rule);
if (isSatisfied) {
executeActions(rule, true);
logger.debug("The rule '{}' is executed.", ruleUID);
} else {
logger.debug("The rule '{}' is NOT executed, since it has unsatisfied conditions.", ruleUID);
if (rule != null) {
boolean isSatisfied = calculateConditions(rule);
if (isSatisfied) {
executeActions(rule, true);
logger.debug("The rule '{}' is executed.", ruleUID);
} else {
logger.debug("The rule '{}' is NOT executed, since it has unsatisfied conditions.", ruleUID);
}
}
} catch (Throwable t) {
logger.error("Failed to execute rule '{}': {}", ruleUID, t.getMessage());