提交 130e09f0 编写于 作者: chenxiang@lab.ibiz5.com's avatar chenxiang@lab.ibiz5.com

2022.11.01.002 处理逻辑相关调整

上级 01aebce7
...@@ -43,10 +43,7 @@ public class LogicLinkModel extends BaseModel { ...@@ -43,10 +43,7 @@ public class LogicLinkModel extends BaseModel {
} }
public String getTargetNodeId() { public String getTargetNodeId() {
String strTargetNodeId = this.getPSDELogicLink().getSrcPSDELogicNode().getCodeName().toLowerCase(); String strTargetNodeId = this.getPSDELogicLink().getDstPSDELogicNode().getCodeName().toLowerCase();
if (this.getPSDELogicLink().getPSDELogicLinkGroupCond() != null) {
strTargetNodeId = String.format("gateway-%s", strTargetNodeId);
}
return strTargetNodeId; return strTargetNodeId;
} }
......
...@@ -50,7 +50,7 @@ public class LogicModel extends BaseModel { ...@@ -50,7 +50,7 @@ public class LogicModel extends BaseModel {
bpmnTnsParams.add(bpmnGlobalIdentifier); bpmnTnsParams.add(bpmnGlobalIdentifier);
} else { } else {
String strDataType = "java.util.Map"; String strDataType = "java.util.Map";
ruleGlobalParams.add(String.format("global %s %s;", strDataType, strParamName)); ruleGlobalParams.add(String.format("global %s %s;", strDataType, "param_"+strParamName));
} }
} }
} }
...@@ -72,7 +72,7 @@ public class LogicModel extends BaseModel { ...@@ -72,7 +72,7 @@ public class LogicModel extends BaseModel {
Method method = iPSDELogicNode.getClass().getDeclaredMethod("getDstPSDataEntity"); Method method = iPSDELogicNode.getClass().getDeclaredMethod("getDstPSDataEntity");
IPSDataEntity dstPSDataEntity = (IPSDataEntity) method.invoke(iPSDELogicNode); IPSDataEntity dstPSDataEntity = (IPSDataEntity) method.invoke(iPSDELogicNode);
if (!map.containsKey(dstPSDataEntity.getName())) { if (!map.containsKey(dstPSDataEntity.getName())) {
String strDataType = String.format("%s.core.%s.service.I%sService", String strDataType = String.format("%s.core.%s.service.%sService",
entityModel.getSystem().getPackageName(), entityModel.getSystem().getPackageName(),
dstPSDataEntity.getPSSystemModule().getCodeName().toLowerCase(), dstPSDataEntity.getPSSystemModule().getCodeName().toLowerCase(),
dstPSDataEntity.getCodeName() dstPSDataEntity.getCodeName()
...@@ -80,7 +80,7 @@ public class LogicModel extends BaseModel { ...@@ -80,7 +80,7 @@ public class LogicModel extends BaseModel {
ruleGlobalParams.add(String.format("global %s %s;", strDataType, String.format("%sservice", dstPSDataEntity.getCodeName().toLowerCase()))); ruleGlobalParams.add(String.format("global %s %s;", strDataType, String.format("%sservice", dstPSDataEntity.getCodeName().toLowerCase())));
map.put(dstPSDataEntity.getName(), dstPSDataEntity.getName()); map.put(dstPSDataEntity.getName(), dstPSDataEntity.getName());
String bpmnService = String.format("<tns:metaData express=\"T(cn.ibizlab.util.security.SpringContextHolder).getBean(T(%s.core.%s.service.I%sService))\" name=\"%sservice\" type=\"service\"/>", String bpmnService = String.format("<tns:metaData express=\"T(cn.ibizlab.util.security.SpringContextHolder).getBean(T(%s.core.%s.service.%sService))\" name=\"%sservice\" type=\"service\"/>",
entityModel.getSystem().getPackageName(), entityModel.getSystem().getPackageName(),
dstPSDataEntity.getPSSystemModule().getCodeName().toLowerCase(), dstPSDataEntity.getPSSystemModule().getCodeName().toLowerCase(),
dstPSDataEntity.getCodeName(), dstPSDataEntity.getCodeName(),
......
{{#if (eq logicNodeModel.pSDELogicNode.dstPSDEAction.codeName 'Get')}} {{#if (eq logicNodeModel.pSDELogicNode.dstPSDEAction.codeName 'Get')}}
cn.ibizlab.util.helper.CachedBeanCopier.copy({{lowerCase logicNodeModel.pSDELogicNode.dstPSDataEntity.codeName}}service.get({{lowerCase logicNodeModel.pSDELogicNode.dstPSDELogicParam.codeName}}.get{{logicNodeModel.pSDELogicNode.dstPSDataEntity.keyPSDEField.codeName}}()),{{lowerCase logicNodeModel.pSDELogicNode.dstPSDELogicParam.codeName}}); cn.ibizlab.util.helper.CachedBeanCopier.copy({{lowerCase logicNodeModel.pSDELogicNode.dstPSDataEntity.codeName}}service.get(param_{{lowerCase logicNodeModel.pSDELogicNode.dstPSDELogicParam.codeName}}.get{{logicNodeModel.pSDELogicNode.dstPSDataEntity.keyPSDEField.codeName}}()),param_{{lowerCase logicNodeModel.pSDELogicNode.dstPSDELogicParam.codeName}});
{{else}} {{else}}
{{#if (eq logicNodeModel.pSDELogicNode.dstPSDEAction.codeName 'Remove')}} {{#if (eq logicNodeModel.pSDELogicNode.dstPSDEAction.codeName 'Remove')}}
{{lowerCase logicNodeModel.pSDELogicNode.dstPSDataEntity.codeName}}service.remove({{lowerCase logicNodeModel.pSDELogicNode.dstPSDELogicParam.codeName}}.get{{logicNodeModel.pSDELogicNode.dstPSDataEntity.keyPSDEField.codeName}}()); {{lowerCase logicNodeModel.pSDELogicNode.dstPSDataEntity.codeName}}service.remove(param_{{lowerCase logicNodeModel.pSDELogicNode.dstPSDELogicParam.codeName}}.get{{logicNodeModel.pSDELogicNode.dstPSDataEntity.keyPSDEField.codeName}}());
{{else}} {{else}}
{{lowerCase logicNodeModel.pSDELogicNode.dstPSDataEntity.codeName}}service.{{camelCase logicNodeModel.pSDELogicNode.dstPSDEAction.codeName}}({{lowerCase logicNodeModel.pSDELogicNode.dstPSDELogicParam.codeName}}); {{lowerCase logicNodeModel.pSDELogicNode.dstPSDataEntity.codeName}}service.{{camelCase logicNodeModel.pSDELogicNode.dstPSDEAction.codeName}}(param_{{lowerCase logicNodeModel.pSDELogicNode.dstPSDELogicParam.codeName}});
{{/if}} {{/if}}
{{/if}} {{/if}}
{{#each logicNodeModel.pSDELogicNode.pSDELogicNodeParams as |nodeParam|}} {{#each logicNodeModel.pSDELogicNode.pSDELogicNodeParams as |nodeParam|}}
{{#if (eq nodeParam.srcValueType "SRCVALUE")}}{{lowerCase nodeParam.dstPSDELogicParam.codeName}}.set("{{lowerCase nodeParam.dstFieldName}}","{{nodeParam.srcValue}}");{{/if}} {{#if (eq nodeParam.srcValueType "SRCVALUE")}}param_{{lowerCase nodeParam.dstPSDELogicParam.codeName}}.set("{{lowerCase nodeParam.dstFieldName}}","{{nodeParam.srcValue}}");{{/if}}
{{#if (eq nodeParam.srcValueType "SRCDLPARAM")}}{{lowerCase nodeParam.dstPSDELogicParam.codeName}}.set("{{lowerCase nodeParam.dstFieldName}}",{{lowerCase nodeParam.srcPSDELogicParam.codeName}}.get("{{lowerCase nodeParam.srcFieldName}}"));{{/if}} {{#if (eq nodeParam.srcValueType "SRCDLPARAM")}}param_{{lowerCase nodeParam.dstPSDELogicParam.codeName}}.set("{{lowerCase nodeParam.dstFieldName}}",param_{{lowerCase nodeParam.srcPSDELogicParam.codeName}}.get("{{lowerCase nodeParam.srcFieldName}}"));{{/if}}
{{#if (eq nodeParam.srcValueType "CURTIME")}}{{lowerCase nodeParam.dstPSDELogicParam.codeName}}.set("{{lowerCase nodeParam.dstFieldName}}",(new java.sql.Timestamp(new java.util.Date().getTime()))));{{/if}} {{#if (eq nodeParam.srcValueType "CURTIME")}}param_{{lowerCase nodeParam.dstPSDELogicParam.codeName}}.set("{{lowerCase nodeParam.dstFieldName}}",(new java.sql.Timestamp(new java.util.Date().getTime()))));{{/if}}
{{#if (eq nodeParam.srcValueType "OPERATOR")}}{{lowerCase nodeParam.dstPSDELogicParam.codeName}}.set("{{lowerCase nodeParam.dstFieldName}}",curuser.getUserid());{{/if}} {{#if (eq nodeParam.srcValueType "OPERATOR")}}param_{{lowerCase nodeParam.dstPSDELogicParam.codeName}}.set("{{lowerCase nodeParam.dstFieldName}}",curuser.getUserid());{{/if}}
{{#if (eq nodeParam.srcValueType "OPERATORNAME")}}{{lowerCase nodeParam.dstPSDELogicParam.codeName}}.set("{{lowerCase nodeParam.dstFieldName}}",curuser.getPersonname());{{/if}} {{#if (eq nodeParam.srcValueType "OPERATORNAME")}}param_{{lowerCase nodeParam.dstPSDELogicParam.codeName}}.set("{{lowerCase nodeParam.dstFieldName}}",curuser.getPersonname());{{/if}}
{{#if (eq nodeParam.srcValueType "CONTEXT")}}{{lowerCase nodeParam.dstPSDELogicParam.codeName}}.set("{{lowerCase nodeParam.dstFieldName}}",default.get("{{lowerCase nodeParam.srcFieldName}}"));{{/if}} {{#if (eq nodeParam.srcValueType "CONTEXT")}}param_{{lowerCase nodeParam.dstPSDELogicParam.codeName}}.set("{{lowerCase nodeParam.dstFieldName}}",param_default.get("{{lowerCase nodeParam.srcFieldName}}"));{{/if}}
{{#if (eq nodeParam.srcValueType "SESSION")}}{{lowerCase nodeParam.dstPSDELogicParam.codeName}}.set("{{lowerCase nodeParam.dstFieldName}}",curuser.getSessionParams().get("{{lowerCase nodeParam.srcFieldName}}"));{{/if}} {{#if (eq nodeParam.srcValueType "SESSION")}}param_{{lowerCase nodeParam.dstPSDELogicParam.codeName}}.set("{{lowerCase nodeParam.dstFieldName}}",curuser.getSessionParams().get("{{lowerCase nodeParam.srcFieldName}}"));{{/if}}
{{#if (eq nodeParam.srcValueType "NULLVALUE")}}{{lowerCase nodeParam.dstPSDELogicParam.codeName}}.set("{{lowerCase nodeParam.dstFieldName}}",null);{{/if}} {{#if (eq nodeParam.srcValueType "NULLVALUE")}}param_{{lowerCase nodeParam.dstPSDELogicParam.codeName}}.set("{{lowerCase nodeParam.dstFieldName}}",null);{{/if}}
{{/each}} {{/each}}
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Map param =new HashMap(); Map param =new HashMap();
{{#each logicNodeModel.pSDELogicNode.pSDELogicNodeParams as |nodeParam|}} {{#each logicNodeModel.pSDELogicNode.pSDELogicNodeParams as |nodeParam|}}
{{#if (eq nodeParam.srcValueType "SRCDLPARAM")}} {{#if (eq nodeParam.srcValueType "SRCDLPARAM")}}
param.put("param{{@index}}",{{lowerCase nodeParam.srcPSDELogicParam.codeName}}.get("{{lowerCase nodeParam.srcFieldName}}")); param.put("param{{@index}}",param_{{lowerCase nodeParam.srcPSDELogicParam.codeName}}.get("{{lowerCase nodeParam.srcFieldName}}"));
{{/if}} {{/if}}
{{#if (eq nodeParam.srcValueType "WEBCONTEXT")}} {{#if (eq nodeParam.srcValueType "WEBCONTEXT")}}
param.put("param{{@index}}",default.get("{{lowerCase nodeParam.srcFieldName}}")); param.put("param{{@index}}",default.get("{{lowerCase nodeParam.srcFieldName}}"));
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Map param =new HashMap(); Map param =new HashMap();
{{#each logicNodeModel.pSDELogicNode.pSDELogicNodeParams as |nodeParam|}} {{#each logicNodeModel.pSDELogicNode.pSDELogicNodeParams as |nodeParam|}}
{{#if (eq nodeParam.srcValueType "SRCDLPARAM")}} {{#if (eq nodeParam.srcValueType "SRCDLPARAM")}}
param.put("param{{@index}}",{{lowerCase nodeParam.srcPSDELogicParam.codeName}}.get("{{lowerCase nodeParam.srcFieldName}}")); param.put("param{{@index}}",param_{{lowerCase nodeParam.srcPSDELogicParam.codeName}}.get("{{lowerCase nodeParam.srcFieldName}}"));
{{/if}} {{/if}}
{{#if (eq nodeParam.srcValueType "WEBCONTEXT")}} {{#if (eq nodeParam.srcValueType "WEBCONTEXT")}}
param.put("param{{@index}}",default.get("{{lowerCase nodeParam.srcFieldName}}")); param.put("param{{@index}}",default.get("{{lowerCase nodeParam.srcFieldName}}"));
...@@ -40,10 +40,10 @@ ...@@ -40,10 +40,10 @@
JSONObject entity=entities.get(0); JSONObject entity=entities.get(0);
{{#if logicNodeModel.pSDELogicNode.dstPSDELogicParam.paramPSDataEntity}} {{#if logicNodeModel.pSDELogicNode.dstPSDELogicParam.paramPSDataEntity}}
for (Map.Entry entry : entity.entrySet()) { for (Map.Entry entry : entity.entrySet()) {
{{lowerCase logicNodeModel.pSDELogicNode.dstPSDELogicParam.codeName}}.set(String.valueOf(entry.getKey()),entry.getValue()); param_{{lowerCase logicNodeModel.pSDELogicNode.dstPSDELogicParam.codeName}}.set(String.valueOf(entry.getKey()),entry.getValue());
} }
{{else}} {{else}}
{{lowerCase logicNodeModel.pSDELogicNode.dstPSDELogicParam.codeName}}.putAll(entity); param_{{lowerCase logicNodeModel.pSDELogicNode.dstPSDELogicParam.codeName}}.putAll(entity);
{{/if}} {{/if}}
} }
{{else}} {{else}}
......
...@@ -16,7 +16,7 @@ no-loop ...@@ -16,7 +16,7 @@ no-loop
//逻辑处理节点[{{logicNodeModel.name}}] //逻辑处理节点[{{logicNodeModel.name}}]
rule "{{lowerCase logicNodeModel.codeName}}" rule "{{lowerCase logicNodeModel.codeName}}"
ruleflow-group "{{lowerCase logicNodeModel.codeName}}" ruleflow-group "{{lowerCase logicNodeModel.codeName}}group"
when when
then then
{{#eq logicNodeModel.logicNodeType "PREPAREPARAM"}}{{> @macro/logic/drl/PrepareParam.hbs logicNodeModel=logicNodeModel}}{{/eq}} {{#eq logicNodeModel.logicNodeType "PREPAREPARAM"}}{{> @macro/logic/drl/PrepareParam.hbs logicNodeModel=logicNodeModel}}{{/eq}}
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
{{#if (eq logicNodeModel.getLogicNodeType 'BEGIN')}} {{#if (eq logicNodeModel.getLogicNodeType 'BEGIN')}}
<startEvent id="{{lowerCase logicNodeModel.codeName}}" isInterrupting="true"/> <startEvent id="{{lowerCase logicNodeModel.codeName}}" isInterrupting="true"/>
{{else}} {{else}}
<businessRuleTask activiti:exclusive="true" g:ruleFlowGroup="{{lowerCase logicNodeModel.codeName}}" id="{{lowerCase logicNodeModel.codeName}}" implementation="http://www.jboss.org/drools/rule" name="{{lowerCase logicNodeModel.name}}"/> <businessRuleTask activiti:exclusive="true" g:ruleFlowGroup="{{lowerCase logicNodeModel.codeName}}group" id="{{lowerCase logicNodeModel.codeName}}" implementation="http://www.jboss.org/drools/rule" name="{{lowerCase logicNodeModel.name}}"/>
{{/if}} {{/if}}
{{#if logicNodeModel.pSDELogicNode.getPSDELogicLinks}} {{#if logicNodeModel.pSDELogicNode.getPSDELogicLinks}}
{{else}} {{else}}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册