From 4ced1931f4e031761d6d16484bb59a975dfcdc68 Mon Sep 17 00:00:00 2001 From: 6407000801 Date: Thu, 16 Mar 2017 10:53:38 +0800 Subject: Fix compileRule Change-Id: Iccf00f37ead7c330e3ca82882166b753f16a5bdb Issue-ID: HOLMES-47 Signed-off-by: FengLiang --- .../main/java/org/openo/holmes/engine/manager/DroolsEngine.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine-d/src/main/java/org/openo/holmes/engine/manager/DroolsEngine.java b/engine-d/src/main/java/org/openo/holmes/engine/manager/DroolsEngine.java index a97cae9..f8d9626 100644 --- a/engine-d/src/main/java/org/openo/holmes/engine/manager/DroolsEngine.java +++ b/engine-d/src/main/java/org/openo/holmes/engine/manager/DroolsEngine.java @@ -162,7 +162,7 @@ public class DroolsEngine { kbuilder.add(res, ResourceType.DRL); - judgeRuleContent(locale, kbuilder); + judgeRuleContent(locale, kbuilder, true); String packageName = kbuilder.getKnowledgePackages().iterator().next().getName(); try { @@ -210,10 +210,10 @@ public class DroolsEngine { kbuilder.add(res, ResourceType.DRL); - judgeRuleContent(locale, kbuilder); + judgeRuleContent(locale, kbuilder, false); } - private void judgeRuleContent(Locale locale, KnowledgeBuilder kbuilder) + private void judgeRuleContent(Locale locale, KnowledgeBuilder kbuilder, boolean judgePackageName) throws CorrelationException { if (kbuilder.hasErrors()) { String errorMsg = I18nProxy.getInstance().getValueByArgs(locale, @@ -225,7 +225,7 @@ public class DroolsEngine { String packageName = kbuilder.getKnowledgePackages().iterator().next().getName(); - if (packageNames.contains(packageName)) { + if (packageNames.contains(packageName) && judgePackageName) { String errorMsg = I18nProxy.getInstance().getValueByArgs(locale, I18nProxy.ENGINE_CONTENT_ILLEGALITY, new String[]{ I18nProxy.getInstance().getValue(locale, I18nProxy.ENGINE_CONTAINS_PACKAGE)}); -- cgit 1.2.3-korg