提交 24d68774 编写于 作者: zhouweidong's avatar zhouweidong

主键判断

上级 04eb4bf5
...@@ -219,22 +219,24 @@ public class DELogicAspect { ...@@ -219,22 +219,24 @@ public class DELogicAspect {
for (ExtensionElement globalParam : globalParams) { for (ExtensionElement globalParam : globalParams) {
Object value = null; Object value = null;
Map<String, List<ExtensionAttribute>> globalParamAttr = globalParam.getAttributes(); Map<String, List<ExtensionAttribute>> globalParamAttr = globalParam.getAttributes();
ExtensionAttribute name = globalParamAttr.get("name").get(0); if (globalParamAttr.containsKey("name") && globalParamAttr.containsKey("type") && globalParamAttr.containsKey("express")) {
ExtensionAttribute type = globalParamAttr.get("type").get(0); ExtensionAttribute name = globalParamAttr.get("name").get(0);
ExtensionAttribute express = globalParamAttr.get("express").get(0); ExtensionAttribute type = globalParamAttr.get("type").get(0);
String express_value = express.getValue(); ExtensionAttribute express = globalParamAttr.get("express").get(0);
EvaluationContext oldContext = new StandardEvaluationContext(); String express_value = express.getValue();
if ("entity".equalsIgnoreCase(type.getValue())) { EvaluationContext oldContext = new StandardEvaluationContext();
value = entity; if ("entity".equalsIgnoreCase(type.getValue())) {
} value = entity;
if (!ObjectUtils.isEmpty(type.getValue()) && ObjectUtils.isEmpty(value)) { }
Expression oldExp = parser.parseExpression(express_value); if (!ObjectUtils.isEmpty(type.getValue()) && ObjectUtils.isEmpty(value)) {
value = oldExp.getValue(oldContext); Expression oldExp = parser.parseExpression(express_value);
} value = oldExp.getValue(oldContext);
if ("entity".equalsIgnoreCase(type.getValue()) || "refentity".equalsIgnoreCase(type.getValue())) { }
kieSession.insert(value); if ("entity".equalsIgnoreCase(type.getValue()) || "refentity".equalsIgnoreCase(type.getValue())) {
kieSession.insert(value);
}
kieSession.setGlobal(name.getValue(), value);
} }
kieSession.setGlobal(name.getValue(), value);
} }
} }
} }
...@@ -736,22 +738,24 @@ public class DELogicAspect { ...@@ -736,22 +738,24 @@ public class DELogicAspect {
for (ExtensionElement globalParam : globalParams) { for (ExtensionElement globalParam : globalParams) {
Object value = null; Object value = null;
Map<String, List<ExtensionAttribute>> globalParamAttr = globalParam.getAttributes(); Map<String, List<ExtensionAttribute>> globalParamAttr = globalParam.getAttributes();
ExtensionAttribute name = globalParamAttr.get("name").get(0); if (globalParamAttr.containsKey("name") && globalParamAttr.containsKey("type") && globalParamAttr.containsKey("express")) {
ExtensionAttribute type = globalParamAttr.get("type").get(0); ExtensionAttribute name = globalParamAttr.get("name").get(0);
ExtensionAttribute express = globalParamAttr.get("express").get(0); ExtensionAttribute type = globalParamAttr.get("type").get(0);
String express_value = express.getValue(); ExtensionAttribute express = globalParamAttr.get("express").get(0);
EvaluationContext oldContext = new StandardEvaluationContext(); String express_value = express.getValue();
if ("entity".equalsIgnoreCase(type.getValue())) { EvaluationContext oldContext = new StandardEvaluationContext();
value = entity; if ("entity".equalsIgnoreCase(type.getValue())) {
} value = entity;
if (!ObjectUtils.isEmpty(type.getValue()) && ObjectUtils.isEmpty(value)) { }
Expression oldExp = parser.parseExpression(express_value); if (!ObjectUtils.isEmpty(type.getValue()) && ObjectUtils.isEmpty(value)) {
value = oldExp.getValue(oldContext); Expression oldExp = parser.parseExpression(express_value);
} value = oldExp.getValue(oldContext);
if ("entity".equalsIgnoreCase(type.getValue()) || "refentity".equalsIgnoreCase(type.getValue())) { }
kieSession.insert(value); if ("entity".equalsIgnoreCase(type.getValue()) || "refentity".equalsIgnoreCase(type.getValue())) {
kieSession.insert(value);
}
kieSession.setGlobal(name.getValue(), value);
} }
kieSession.setGlobal(name.getValue(), value);
} }
} }
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册