summaryrefslogtreecommitdiffstats
path: root/engine-d/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'engine-d/src/main/java')
-rw-r--r--engine-d/src/main/java/org/openo/holmes/engine/manager/DroolsEngine.java8
1 files 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)});