Hello,
why does JSR223 provide both rules from the default preset and ruleRegistry from RuleSupport preset? Their documentation is:
rules Instance of org.openhab.core.automation.RuleRegistry
ruleRegistry org.openhab.core.automation.Rule
When I write in Groovy
logger.info(rules.class.toString())
for (def r : rules.getAll()) logger.info(r.getName())
logger.info(ruleRegistry.class.toString())
for (def r : ruleRegistry.getAll()) logger.info(r.getName())
The system prints:
class org.openhab.core.automation.internal.RuleRegistryImpl
class org.openhab.core.automation.module.script.rulesupport.shared.RuleSupportRuleRegistryDelegate
followed by the same set of rules. So ruleRegistry is not a org.openhab.core.automation.Rule, as described above, but implements RulesRegistry interface. (Rule has no method getAll()).
Why does JSR223 provide two implementations of the RuleRegistry interface? // Дилян