Open chrisschauer opened 7 years ago
Is it expected behaviour that the rule is still available if the provided bundle is removed?
In my use case it does not make sense to keep the rule if the bundle isn't installed. In general I would also suggest a way, where the rule is removed/or disabled if the bundle is stopped.
the RuleResourceBundleImporter
is not a RuleProvider
but actually does (or better: tries to do) an import, therefore saving the rule in the ManagedRuleProvider
. So it rather looks like purpose and not like a bug.
That way of implementing it IMHO is (at least) surprising, considering the way how it works for all the other entities within ESH...
@chrisschauer you can't overwrite existing rule, because all the changes made on that rule will be lost on restart of the system. This is expected behavior. If you want to remove a rule you have to delete it explicitly. Of course you can do such read only rule provider which will provide read only rules from bundle. These rules can be enabled/disabled by the RuleEngine, but they can't be changed (updated) or removed on anyway. @maggu2810 expected behavior is to remove the rules from provider when the provider is disappeared. These means the imported rules have to disappeared when the managed provider is removed (not bundle from which they was imported). Unfortunately it does not work for rules coming from managed rule provider but it is fixred in PR #2194 @sjka you are right the bundle resource importer is not a provider itself, it is importer which imports rules through the rule registry into rule managed provider.
Hi,
i can't found any specification how rules from bundle resources are imported. So I decided to start with this issue a discussion.
Problem I have a binding which includes a rule (maybe for rule-templates it's the same) in the bundle resources under /ESH-INF/automation/rules as JSON. The first rule import works perfect. But on every further restart of the bundle the importer tries to re-add the rule and this exception occurs:
Expected behavior The importer reacts like this...