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

切面逻辑优化

上级 04337514
...@@ -19,9 +19,9 @@ TARGET=PSDELOGIC ...@@ -19,9 +19,9 @@ TARGET=PSDELOGIC
<tns:metaData express="" name="${paramObj}" type="entity"/> <tns:metaData express="" name="${paramObj}" type="entity"/>
<#elseif logicParam.getParamPSDataEntity?? && logicParam.getParamPSDataEntity()??> <#elseif logicParam.getParamPSDataEntity?? && logicParam.getParamPSDataEntity()??>
<#assign ParamPSDataEntity=logicParam.getParamPSDataEntity()> <#assign ParamPSDataEntity=logicParam.getParamPSDataEntity()>
<tns:metaData express="new ${pub.getPKGCodeName()}.core.${ParamPSDataEntity.getPSSystemModule().codeName?lower_case}.domain.${ParamPSDataEntity.codeName}()" name="${(logicName+logicParam.codeName)?lower_case}" type="ref"/> <tns:metaData express="new ${pub.getPKGCodeName()}.core.${ParamPSDataEntity.getPSSystemModule().codeName?lower_case}.domain.${ParamPSDataEntity.codeName}()" name="${(logicName+logicParam.codeName)?lower_case}" type="refentity"/>
<#else> <#else>
<tns:metaData express="new HashMap()" name="${(logicName+logicParam.codeName)?lower_case}" type="ref"/> <tns:metaData express="new HashMap()" name="${(logicName+logicParam.codeName)?lower_case}" type="refentity"/>
</#if> </#if>
</#list> </#list>
</#if> </#if>
......
...@@ -79,7 +79,6 @@ public class DELogicAspect { ...@@ -79,7 +79,6 @@ public class DELogicAspect {
@Value("${r'$'}{ibiz.systemid:${sys.getCodeName()}}") @Value("${r'$'}{ibiz.systemid:${sys.getCodeName()}}")
private String systemId; private String systemId;
/** /**
* 执行实体行为附加逻辑、实体行为调用处理逻辑 * 执行实体行为附加逻辑、实体行为调用处理逻辑
* *
...@@ -250,6 +249,9 @@ public class DELogicAspect { ...@@ -250,6 +249,9 @@ public class DELogicAspect {
Expression oldExp = parser.parseExpression(express_value); Expression oldExp = parser.parseExpression(express_value);
value = oldExp.getValue(oldContext); value = oldExp.getValue(oldContext);
} }
if("entity".equalsIgnoreCase(type.getValue()) || "refentity".equalsIgnoreCase(type.getValue())){
kieSession.insert(entity);
}
kieSession.setGlobal(name.getValue(), value); kieSession.setGlobal(name.getValue(), value);
} }
} }
...@@ -385,8 +387,8 @@ public class DELogicAspect { ...@@ -385,8 +387,8 @@ public class DELogicAspect {
* @return * @return
*/ */
private File getRemoteModel(String module, String entity, String action, String actionLogic) { private File getRemoteModel(String module, String entity, String action, String actionLogic) {
String logicName = String.format("PSDEACTION.json.%s.bpmn", actionLogic); String logicName = String.format("psdeaction.json.%s.bpmn", actionLogic);
return new File(dynamicPath + File.separator + systemId + File.separator + "PSMODULES" + File.separator + module + File.separator + "PSDATAENTITIES" + File.separator + entity + File.separator + "PSDEACTIONS" + File.separator + action + File.separator + logicName); return new File(dynamicPath + File.separator + (systemId + File.separator + "psmodules" + File.separator + module + File.separator + "psdataentities" + File.separator + entity + File.separator + "psdeactions" + File.separator + action + File.separator + logicName).toLowerCase());
} }
/** /**
...@@ -399,7 +401,7 @@ public class DELogicAspect { ...@@ -399,7 +401,7 @@ public class DELogicAspect {
*/ */
private File getSubBpmn(String module, String entity, String logicName, LogicMode logicMode) { private File getSubBpmn(String module, String entity, String logicName, LogicMode logicMode) {
if (LogicMode.REMOTE.equals(logicMode)) { if (LogicMode.REMOTE.equals(logicMode)) {
return new File(dynamicPath + File.separator + systemId + File.separator + "PSMODULES" + File.separator + module + File.separator + "PSDATAENTITIES" + File.separator + entity + File.separator + "PSDELOGICS" + File.separator + logicName + File.separator + "PSDELOGIC.json.bpmn"); return new File(dynamicPath + File.separator + (systemId + File.separator + "psmodules" + File.separator + module + File.separator + "psdataentities" + File.separator + entity + File.separator + "psdelogics" + File.separator + logicName + File.separator + "psdelogic.json.bpmn").toLowerCase());
} else { } else {
String filePath = String.format("/rules/%s%sRuleFlow.bpmn", entity, logicName); String filePath = String.format("/rules/%s%sRuleFlow.bpmn", entity, logicName);
return ObjectUtils.isEmpty(this.getClass().getResource(filePath)) ? null : new File(this.getClass().getResource(filePath).getPath()); return ObjectUtils.isEmpty(this.getClass().getResource(filePath)) ? null : new File(this.getClass().getResource(filePath).getPath());
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册