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

Signed-off-by: Jonathan Gilbert <jpg@trillica.com>
pull/2161/head
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
1 changed files with 8 additions and 1 deletions

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;
}