Add ability for scripts to create unmanaged rules (#1897)

Signed-off-by: Jonathan Gilbert <jpg@trillica.com>
This commit is contained in:
Jonathan Gilbert 2021-01-27 08:25:09 +11:00 committed by GitHub
parent f0c9a8434d
commit f1a3d824ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,6 +106,14 @@ public class ScriptedAutomationManager {
}
public Rule addRule(Rule element) {
Rule rule = addUnmanagedRule(element);
ruleRegistryDelegate.add(rule);
return rule;
}
public Rule addUnmanagedRule(Rule element) {
RuleBuilder builder = RuleBuilder.create(element.getUID());
String name = element.getName();
@ -173,7 +181,6 @@ public class ScriptedAutomationManager {
Rule rule = builder.build();
ruleRegistryDelegate.add(rule);
return rule;
}