提交 028d3bf6 编写于 作者: xignzi006's avatar xignzi006 🇨🇳

移除,由edge模板发布

上级 45b9bef6
<#ibiztemplate>
TARGET=PSDELOGIC
</#ibiztemplate>
<#comment>引入驼峰配置</#comment>
<#ibizinclude>/SLN/globalfunc.cfg</#ibizinclude>
<#if item.isEnableBackend()>
package ${pub.getPKGCodeName()}.${de.getPSSystemModule().codeName?lower_case}.logic.${de.codeName?lower_case}logic.${item.getCodeName()?lower_case};
<#comment>是否包含启动工作流节点</#comment>
<#assign startWF=false>
<#if item.getPSDELogicNodes?? && item.getPSDELogicNodes()??>
<#list item.getPSDELogicNodes() as deLogicNode>
<#if deLogicNode.getLogicNodeType()=='STARTWF'>
<#assign startWF=true>
<#break>
</#if>
</#list>
</#if>
<#assign logicName=(de.codeName+item.codeName)?lower_case>
<#assign delogic=item>
<#assign defaultLogicParam="">
<#comment>插入逻辑参数</#comment>
<#if delogic.getPSDELogicParams?? && delogic.getPSDELogicParams()??>
import java.util.Map;
import java.util.HashMap;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
import org.springframework.util.ObjectUtils;
import ${pub.getPKGCodeName()}.util.errors.BadRequestAlertException;
<#list delogic.getPSDELogicParams() as logicParam>
<#if logicParam.isDefault()==true>
<#assign defaultLogicParam=logicParam><#comment>获取处理逻辑中默认逻辑参数</#comment>
</#if>
<#if logicParam.getParamPSDataEntity?? && logicParam.getParamPSDataEntity()??>
<#assign ParamPSDataEntity=logicParam.getParamPSDataEntity()>
global ${pub.getPKGCodeName()}.core.${ParamPSDataEntity.getPSSystemModule().codeName?lower_case}.domain.${ParamPSDataEntity.codeName} ${logicName+logicParam.codeName?lower_case};
<#else>
global java.util.Map ${logicName+logicParam.codeName?lower_case};
</#if>
</#list>
</#if>
<#comment>插入wfclient</#comment>
<#if startWF>
global ${pub.getPKGCodeName()}.util.client.IBZWFFeignClient wfClient;
</#if>
<#comment>插入处理逻辑中所用到的service对象</#comment>
<#if delogic.getPSDELogicNodes?? && delogic.getPSDELogicNodes()??>
<#list delogic.getPSDELogicNodes() as deLogicNode>
<#if deLogicNode.getDstPSDataEntity?? && deLogicNode.getDstPSDataEntity()??>
<#if !P.exists("kieSession",deLogicNode.getDstPSDataEntity().getCodeName()?lower_case,"service")>
<#assign DstPSDataEntity=deLogicNode.getDstPSDataEntity()>
global ${pub.getPKGCodeName()}.core.${DstPSDataEntity.getPSSystemModule().codeName?lower_case}.service.I${DstPSDataEntity.codeName}Service ${deLogicNode.getDstPSDataEntity().getCodeName()?lower_case}service;
</#if>
</#if>
</#list>
<#comment>插入当前实体的defaultService对象,供自定义查询使用</#comment>
global ${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.service.I${de.codeName}Service iBzSys${de.codeName?lower_case?cap_first}DefaultService;
global ${pub.getPKGCodeName()}.util.security.AuthenticationUser curuser;
</#if>
no-loop
<#if delogic.getPSDELogicNodes?? && delogic.getPSDELogicNodes()??>
<#list delogic.getPSDELogicNodes() as deLogicNode>
//逻辑处理节点[${deLogicNode.getName()?lower_case}]
rule "${deLogicNode.getCodeName()?lower_case}"
ruleflow-group "${logicName+deLogicNode.getCodeName()?lower_case}"
when
then
<#if deLogicNode.codeName !='Begin'><#comment>开始节点不输出内容</#comment>
<#if deLogicNode.getLogicNodeType()=='PREPAREPARAM' && deLogicNode.getPSDELogicNodeParams()??><#comment>准备参数</#comment>
<#list deLogicNode.getPSDELogicNodeParams() as nodeParam>
<#assign targetLogicParam=nodeParam.getDstPSDELogicParam()>
<#assign targetLogicFieldName=nodeParam.getDstFieldName()>
<#if targetLogicParam.getParamPSDataEntity().getPSDEField(targetLogicFieldName,true)??>
<#assign targetLogicFieldName=srfr7templcaseformat(targetLogicParam.getParamPSDataEntity().getPSDEField(targetLogicFieldName,true).getCodeName())>
</#if>
<#if nodeParam.getSrcValueType()=='SRCVALUE'><#comment>直接值</#comment>
${logicName+targetLogicParam.getCodeName()?lower_case}.set("${targetLogicFieldName?lower_case}","${nodeParam.getSrcValue()}");
<#elseif nodeParam.getSrcValueType()=='SRCDLPARAM' ><#comment>源逻辑参数</#comment>
<#assign srcPSDELogicParam=nodeParam.getSrcPSDELogicParam()>
<#assign srcFieldName=nodeParam.getSrcFieldName()>
<#if srcPSDELogicParam.getParamPSDataEntity().getPSDEField(srcFieldName,true)??>
<#assign srcFieldName=srfr7templcaseformat(srcPSDELogicParam.getParamPSDataEntity().getPSDEField(srcFieldName,true).getCodeName())>
</#if>
${logicName+targetLogicParam.getCodeName()?lower_case}.set("${targetLogicFieldName?lower_case}",${logicName+srcPSDELogicParam.getCodeName()?lower_case}.get("${srcFieldName?lower_case}"));<#comment>源逻辑参数选择了实体</#comment>
<#else>
<#assign srcFieldName=nodeParam.getSrcFieldName()>
<#if nodeParam.getSrcValueType()=="CURTIME">
${logicName+targetLogicParam.getCodeName()?lower_case}.set("${targetLogicFieldName?lower_case}",(new java.sql.Timestamp(new java.util.Date().getTime()))));
<#elseif nodeParam.getSrcValueType()=="OPERATOR">
${logicName+targetLogicParam.getCodeName()?lower_case}.set("${targetLogicFieldName?lower_case}",curuser.getUserid());
<#elseif nodeParam.getSrcValueType()=="OPERATORNAME">
${logicName+targetLogicParam.getCodeName()?lower_case}.set("${targetLogicFieldName?lower_case}",curuser.getPersonname());
<#elseif nodeParam.getSrcValueType()=="CONTEXT">
${logicName+targetLogicParam.getCodeName()?lower_case}.set("${targetLogicFieldName?lower_case}",${logicName+"default"}.get("${srcFieldName?lower_case}"));<#comment>源逻辑参数选择了实体</#comment>
<#elseif nodeParam.getSrcValueType()=="SESSION">
${logicName+targetLogicParam.getCodeName()?lower_case}.set("${targetLogicFieldName?lower_case}",curuser.getSessionParams().get("${srcFieldName?lower_case}"));
<#elseif nodeParam.getSrcValueType()=="NULLVALUE">
${logicName+targetLogicParam.getCodeName()?lower_case}.set("${targetLogicFieldName?lower_case}",null);
</#if>
</#if>
</#list>
<#elseif deLogicNode.getLogicNodeType()=='DEACTION'><#comment>调用实体行为</#comment>
<#assign operateEntity=deLogicNode.getDstPSDataEntity()><#comment>操作实体</#comment>
<#assign operateAction=deLogicNode.getDstPSDEAction()><#comment>操作行为</#comment>
<#assign operateParam=deLogicNode.getDstPSDELogicParam()><#comment>操作参数</#comment>
<#assign logicParamEntity=logicName+operateParam.codeName?lower_case>
<#if deLogicNode.getDstPSDEAction().codeName?lower_case=='get'>
<#if operateEntity.getKeyPSDEField()??>
<#assign operateEntityKeyField=srfr7templcaseformat(operateEntity.getKeyPSDEField().getCodeName())?cap_first>
${pub.getPKGCodeName()}.util.helper.CachedBeanCopier.copy(${operateEntity.codeName?lower_case}service.get(${logicParamEntity}.get${operateEntityKeyField}()),${logicParamEntity});
<#else>
//操作实体没有主键属性,未能正常发布出get行为
</#if>
<#elseif deLogicNode.getDstPSDEAction().codeName?lower_case=='remove'>
<#assign operateEntityKeyField=srfr7templcaseformat(operateEntity.getKeyPSDEField().getCodeName())?cap_first>
${operateEntity.codeName?lower_case}service.remove(${logicParamEntity}.get${operateEntityKeyField}());
<#else>
${operateEntity.codeName?lower_case}service.${operateAction.codeName?uncap_first}(${logicParamEntity});
</#if>
<#elseif deLogicNode.getLogicNodeType()=='RAWSQLCALL'><#comment>直接SQL</#comment>
<#if deLogicNode.getPSDELogicNodeParams()??>
<#comment>包含参数列表</#comment>
<@getCallSQL2 deLogicNode/>
<#else>
Map param = null;
String strSql="${srfjavasqlcode('${deLogicNode.getParam("PARAM4","")}')}";
</#if>
<#if (deLogicNode.getParam("PARAM9",0)==1)>
java.util.List<JSONObject> entities=iBzSys${de.codeName?lower_case?cap_first}DefaultService.select(strSql,param);//SQL调用
<#comment>是否返回参数</#comment>
<#if deLogicNode.getDstPSDELogicParam?? && deLogicNode.getDstPSDELogicParam()?? ><#comment>配置返回参数</#comment>
if(entities.size()>0 && !ObjectUtils.isEmpty(entities.get(0))){
<#assign targetLogicParam=deLogicNode.getDstPSDELogicParam()>
JSONObject entity=entities.get(0);
<#assign targetLogicParamCodeName=logicName+targetLogicParam.getCodeName()?lower_case>
<#if targetLogicParam.getParamPSDataEntity?? && targetLogicParam.getParamPSDataEntity()??>
<#assign targetEntity=targetLogicParam.getParamPSDataEntity()>
<#if (deLogicNode.getParam("PARAM7",1)==0)><#comment>重置原数据</#comment>
${pub.getPKGCodeName()}.core.${targetEntity.getPSSystemModule().codeName?lower_case}.domain.${targetEntity.codeName} targetEntity =new ${pub.getPKGCodeName()}.core.${targetEntity.getPSSystemModule().codeName?lower_case}.domain.${targetEntity.codeName}();
for (Map.Entry entry : entity.entrySet()) {
targetEntity.set(String.valueOf(entry.getKey()),entry.getValue());
}
org.springframework.cglib.beans.BeanCopier copier= org.springframework.cglib.beans.BeanCopier.create(targetEntity.getClass(),${targetLogicParamCodeName}.getClass(), false);
copier.copy(targetEntity,${targetLogicParamCodeName},null);
<#else><#comment>不重置原数据</#comment>
for (Map.Entry entry : entity.entrySet()) {
${targetLogicParamCodeName}.set(String.valueOf(entry.getKey()),entry.getValue());
}
</#if>
<#else>
${targetLogicParamCodeName}.putAll(entity);
</#if>
}
<#else>
iBzSys${de.codeName?lower_case?cap_first}DefaultService.execute(strSql);//SQL调用
</#if>
<#else>
iBzSys${de.codeName?lower_case?cap_first}DefaultService.execute(strSql,param);//SQL调用
</#if>
<#elseif deLogicNode.getLogicNodeType()=='RAWSQLANDLOOPCALL'><#comment>直接SQL并循环调用</#comment>
<#if deLogicNode.getPSDELogicNodeParams()??>
<#comment>包含参数列表</#comment>
<@getCallSQL2 deLogicNode/>
<#else>
Map param = null;
String strSql="${srfjavasqlcode('${deLogicNode.getParam("PARAM4","")}')}";
</#if>
java.util.List<JSONObject> entities=iBzSys${de.codeName?lower_case?cap_first}DefaultService.select(strSql,param);//SQL调用
if(entities.size()>0){
<#if deLogicNode.getDstPSDataEntity?? && deLogicNode.getDstPSDataEntity()?? &&deLogicNode.getDstPSDEAction?? && deLogicNode.getDstPSDEAction()??>
<#assign targetEntity=deLogicNode.getDstPSDataEntity()>
<#assign targetAction=deLogicNode.getDstPSDEAction()>
for(JSONObject entity:entities){
${pub.getPKGCodeName()}.core.${targetEntity.getPSSystemModule().codeName?lower_case}.domain.${targetEntity.codeName} targetEntity =new ${pub.getPKGCodeName()}.core.${targetEntity.getPSSystemModule().codeName?lower_case}.domain.${targetEntity.codeName}();
for (Map.Entry<String,Object> entry : entity.entrySet()) {
targetEntity.set(entry.getKey(),entry.getValue());
}
${targetEntity.codeName?lower_case}service.${targetAction.codeName?lower_case}(targetEntity);
}
</#if>
}
<#elseif deLogicNode.getLogicNodeType()=='STARTWF'><#comment>启动工作流</#comment>
<#assign wfDE=deLogicNode.getPSDEWF().getPSDataEntity()>
<#assign wfDEKeyField=srfr7templcaseformat(wfDE.getKeyPSDEField().codeName)>
<#assign wfParam=deLogicNode.getDstPSDELogicParam()>
<#assign wfLogicParam=(logicName+wfParam.codeName)?lower_case>
<#assign wfDECodeName=srfpluralize(wfDE.getCodeName()?lower_case)>
<#assign appName="">
<#if wfDE.hasPSAppDataEntity()??>
<#list wfDE.getAllPSAppDataEntities() as WFAppDE>
<#assign appName=((WFAppDE.getPSApplication().getPKGCodeName())!'')?lower_case>
<#break>
</#list>
</#if>
JSONObject activeData=(JSONObject) JSONObject.toJSON(${wfLogicParam});
Object businessKey=${wfLogicParam}.get("${wfDEKeyField}");
String appName="${appName}";
if(StringUtils.isEmpty(appName))
throw new BadRequestAlertException("无法获取流程应用名称,请检查[${wfDE.getLogicName()}]实体是否已经添加到应用","StartWF","");
if(ObjectUtils.isEmpty(businessKey))
throw new BadRequestAlertException("启动流程失败,逻辑参数[${wfParam.codeName?lower_case}]中未包含实体业务主键","StartWF","");
wfClient.wfstart("${sys.codeName}",appName,"${wfDECodeName}",String.valueOf(businessKey),activeData);
</#if>
<#if delogic.getPSDELogicParams?? && delogic.getPSDELogicParams()??>
<#list delogic.getPSDELogicParams() as logicParam>
update(${logicName+logicParam.codeName?lower_case});//更新fact中变量值
</#list>
</#if>
</#if>
end
</#list>
</#if>
</#if>
<#macro getCallSQL2 deLogicNode >
Map param =new HashMap();
<#comment>准备参数列表</#comment>
<#list deLogicNode.getPSDELogicNodeParams() as nodeParam>
<#assign sqlParam="null">
<#assign srcFieldName=nodeParam.getSrcFieldName()>
<#assign curLogicEntity=logicName+"default">
<#if nodeParam.getSrcValueType()=='SRCDLPARAM'><#comment>源逻辑参数</#comment>
<#assign srcPSDELogicParam=nodeParam.getSrcPSDELogicParam()>
<#if srcPSDELogicParam.getParamPSDataEntity().getPSDEField(srcFieldName,true)??>
<#assign srcFieldName=srfr7templcaseformat(srcPSDELogicParam.getParamPSDataEntity().getPSDEField(srcFieldName,true).getCodeName())>
</#if>
<#assign srfLogicParamEntity=logicName+srcPSDELogicParam.getCodeName()?lower_case>
<#assign sqlParam=srfLogicParamEntity+".get(\""+srcFieldName?lower_case+"\")">
<#elseif nodeParam.getSrcValueType()=="WEBCONTEXT"><#comment>网页请求上下文</#comment>
<#assign sqlParam=curLogicEntity+".get(\""+srcFieldName?lower_case+"\")">
<#elseif nodeParam.getSrcValueType()=="APPDATA"><#comment>当前应用数据</#comment>
<#elseif nodeParam.getSrcValueType()=="APPLICATION"><#comment>系统全局对象</#comment>
<#elseif nodeParam.getSrcValueType()=="SESSION"><#comment>用户全局对象</#comment>
<#assign sqlParam="curuser.getSessionParams().get(\""+srcFieldName?lower_case+"\")">
<#elseif nodeParam.getSrcValueType()=="DATACONTEXT"><#comment>数据上下文</#comment>
<#assign sqlParam=curLogicEntity+".get(\""+srcFieldName?lower_case+"\")">
<#elseif nodeParam.getSrcValueType()=="ENVPARAM"><#comment>当前环境参数</#comment>
<#elseif nodeParam.getSrcValueType()=="VIEWPARAM"><#comment>当前视图参数</#comment>
<#elseif nodeParam.getSrcValueType()=="NONE"><#comment>无值</#comment>
<#elseif nodeParam.getSrcValueType()=="NULLVALUE"><#comment>空值</#comment>
<#elseif nodeParam.getSrcValueType()=="SRCVALUE"><#comment>直接值</#comment>
<#assign sqlParam="\""+nodeParam.getSrcValue()+"\"">
<#else>
<#comment>暂未支持其余准备参数设置</#comment>
</#if>
param.put("param${nodeParam_index}",${sqlParam});
</#list>
<#comment>将占位符?替换为#{et.param1}</#comment>
<#assign sql=srfjavasqlcode('${deLogicNode.getParam("PARAM4","")}')>
<#list deLogicNode.getPSDELogicNodeParams() as nodeParam>
<#assign sql=sql?replace("?","#"+"{et.param"+nodeParam_index+"}","f")>
</#list>
String strSql="${sql}";
</#macro>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSDELOGIC
</#ibiztemplate>
<#comment>引入驼峰配置</#comment>
<#ibizinclude>/SLN/globalfunc.cfg</#ibizinclude>
<#if item.isEnableBackend()>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:g="http://www.jboss.org/drools/flow/gpd" xmlns:tns="http://www.jboss.org/drools" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.mvel.org/2.0" id="Definition" name="" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
<process id="${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.service.logic.${de.codeName?lower_case}${item.getCodeName()?lower_case}" isClosed="false" isExecutable="true" name="${de.getPSSystemModule().codeName?lower_case}_${de.codeName?lower_case}_${item.codeName?lower_case}_RuleFlow" processType="Private" tns:packageName="${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.service.logic.${de.codeName?lower_case}${item.getCodeName()?lower_case}">
<extensionElements>
<tns:import name="java.util.Map" />
<tns:import name="org.springframework.util.StringUtils"/>
<tns:import name="${pub.getPKGCodeName()}.util.helper.RuleUtils"/>
<#comment>插入逻辑参数</#comment>
<#if item.getPSDELogicParams?? && item.getPSDELogicParams()??>
<#assign logicName=(de.codeName+item.codeName)?lower_case>
<#list item.getPSDELogicParams() as logicParam>
<#assign paramObj=(logicName+logicParam.codeName)?lower_case>
<#if logicParam.isDefault()==true><#comment>默认变量</#comment>
<tns:metaData express="" name="${paramObj}" type="entity"/>
<#elseif logicParam.getParamPSDataEntity?? && 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="refentity"/>
<#else>
<tns:metaData express="new HashMap()" name="${(logicName+logicParam.codeName)?lower_case}" type="refentity"/>
</#if>
</#list>
</#if>
<#comment>插入处理逻辑中所用到的service对象</#comment>
<#if item.getPSDELogicNodes?? && item.getPSDELogicNodes()??>
<#list item.getPSDELogicNodes() as deLogicNode>
<#if deLogicNode.getDstPSDataEntity?? && deLogicNode.getDstPSDataEntity()??>
<#assign nodePSDataEntity=deLogicNode.getDstPSDataEntity()>
<#if !P.exists(item.codeName,"kieSessionGlobalServiceBpmn",deLogicNode.getDstPSDataEntity().getCodeName()?lower_case)>
<tns:metaData express="T(${pub.getPKGCodeName()}.util.security.SpringContextHolder).getBean(T(${pub.getPKGCodeName()}.core.${nodePSDataEntity.getPSSystemModule().codeName?lower_case}.service.I${nodePSDataEntity.codeName}Service))" name="${deLogicNode.getDstPSDataEntity().getCodeName()?lower_case}service" type="service"/>
</#if>
</#if>
</#list>
</#if>
<#comment>插入当前实体的defaultService对象,供自定义查询使用</#comment>
<tns:metaData express="T(${pub.getPKGCodeName()}.util.security.SpringContextHolder).getBean(T(${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.service.I${de.codeName}Service))" name="iBzSys${de.codeName?lower_case?cap_first}DefaultService" type="service"/>
<tns:metaData express="T(${pub.getPKGCodeName()}.util.security.AuthenticationUser).getAuthenticationUser()" name="curuser" type="session"/>
<#assign logicName=(de.codeName+item.codeName)?lower_case>
<#comment>插入逻辑参数</#comment>
<#if item.getPSDELogicParams?? && item.getPSDELogicParams()??>
<#list item.getPSDELogicParams() as logicParam>
<#if logicParam.getParamPSDataEntity?? && logicParam.getParamPSDataEntity()??>
<#assign ParamPSDataEntity=logicParam.getParamPSDataEntity()>
<tns:global identifier="${logicName+logicParam.codeName?lower_case}" type="${pub.getPKGCodeName()}.core.${ParamPSDataEntity.getPSSystemModule().codeName?lower_case}.domain.${ParamPSDataEntity.codeName}" />
<#else>
</#if>
</#list>
</#if>
</extensionElements>
<#comment>绘制处理节点</#comment>
<#if item.getPSDELogicNodes?? && item.getPSDELogicNodes()??>
<#list item.getPSDELogicNodes() as logicNode>
<#if logicNode.getLogicNodeType()=='BEGIN'>
<startEvent id="${logicNode.getCodeName()?lower_case}" isInterrupting="true"/>
<#else>
<businessRuleTask activiti:exclusive="true" g:ruleFlowGroup="${logicName+logicNode.getCodeName()?lower_case}" id="${logicNode.getCodeName()?lower_case}" implementation="http://www.jboss.org/drools/rule" name="${logicNode.getName()}"/>
</#if>
<#if !(logicNode.getPSDELogicLinks()??)><#comment>是否为流程最后一个处理节点,若为最后一个处理节点则生成End节点</#comment>
<endEvent id="${logicNode.getCodeName()?lower_case}_end" name="end"/>
<sequenceFlow id="${logicNode.getCodeName()?lower_case}_end_line" sourceRef="${logicNode.getCodeName()?lower_case}" targetRef="${logicNode.getCodeName()?lower_case}_end"/><#comment>生成流程最后一个处理节点与End节点之间的连线</#comment>
</#if>
</#list>
</#if>
<#comment>绘制节点连线</#comment>
<#if item.getPSDELogicLinks?? && item.getPSDELogicLinks()??>
<#list item.getPSDELogicLinks() as LogicLink>
<#assign sourceNodeId=LogicLink.getSrcPSDELogicNode().getCodeName()?lower_case>
<#if LogicLink.getPSDELogicLinkGroupCond?? && LogicLink.getPSDELogicLinkGroupCond()??><#comment>判断连接线含有条件,若有条件,则将源节点指向网关</#comment>
<#assign sourceNodeId=("gateway-"+LogicLink.getSrcPSDELogicNode().getCodeName())?lower_case>
</#if>
<#assign targetNodeId=LogicLink.getDstPSDELogicNode().getCodeName()?lower_case>
<sequenceFlow id="${sourceNodeId}_${targetNodeId}" sourceRef="${sourceNodeId}" targetRef="${targetNodeId}">
<#if LogicLink.getPSDELogicLinkGroupCond?? && LogicLink.getPSDELogicLinkGroupCond()??><#comment>连接线含有条件</#comment>
<conditionExpression language="http://www.jboss.org/drools/rule" ><![CDATA[
<#comment>准备逻辑参数</#comment>
<#if item.getPSDELogicParams?? && item.getPSDELogicParams()??>
<#list item.getPSDELogicParams() as logicParam>
<#if logicParam.getParamPSDataEntity?? && logicParam.getParamPSDataEntity()??>
<#assign ParamPSDataEntity=logicParam.getParamPSDataEntity()>
$${logicName+logicParam.codeName?lower_case}:${ParamPSDataEntity.codeName}();
<#else>
$${logicName+logicParam.codeName?lower_case}:Map();
</#if>
</#list>
<#assign strExpCond=getConditionExpression(item)>
eval(${strExpCond});<#comment>在fact中寻找与global中对应参数</#comment>
</#if>
<#assign LogicLinkCond=LogicLink.getPSDELogicLinkGroupCond()>
<#assign strGroupCond=getGroupCond(LogicLinkCond)>
eval${strGroupCond}
]]>
</conditionExpression>
</#if>
</sequenceFlow>
</#list>
</#if>
<#comment>生成交互网关节点</#comment>
<#if item.getPSDELogicLinks?? && item.getPSDELogicLinks()??>
<#list item.getPSDELogicLinks() as LogicLink>
<#if LogicLink.getPSDELogicLinkGroupCond?? && LogicLink.getPSDELogicLinkGroupCond()??><#comment>连接线含有条件</#comment>
<#assign gatewayId="gateway-"+LogicLink.getSrcPSDELogicNode().getCodeName()?lower_case>
<#if !P.exists("gateway",gatewayId)>
<#comment>绘制网关</#comment>
<exclusiveGateway id="${gatewayId}" name="Gateway" gatewayDirection="Diverging" default="${gatewayId}_end_line"></exclusiveGateway>
<#comment>绘制网关与源节点的连线</#comment>
<#assign sourceNodeId=LogicLink.getSrcPSDELogicNode().getCodeName()?lower_case>
<sequenceFlow id="${sourceNodeId}_${gatewayId}_gatewayline" sourceRef="${sourceNodeId}" targetRef="${gatewayId}"></sequenceFlow>
</#if>
<#comment>绘制网关默认结束节点</#comment>
<#if !P.exists("gateway-end",gatewayId)>
<sequenceFlow id="${gatewayId}_end_line" sourceRef="${gatewayId}" targetRef="${gatewayId}_end"/><#comment>生成流程最后一个处理节点与End节点之间的连线</#comment>
<endEvent id="${gatewayId}_end" name="end"/>
</#if>
</#if>
</#list>
</#if>
</process>
</definitions>
</#if>
<#comment>获取组合条件表达式</#comment>
<#function getGroupCond LogicLinkCond>
<#assign strRuleCond="(">
<#if LogicLinkCond.getPSDELogicLinkConds?? && LogicLinkCond.getPSDELogicLinkConds()??><#comment>判断是否有组条件</#comment>
<#list LogicLinkCond.getPSDELogicLinkConds() as childLogicLinkCond><#comment>组条件,递归</#comment>
<#if childLogicLinkCond.getPSDELogicLinkConds?? && childLogicLinkCond.getPSDELogicLinkConds()??>
<#assign strRuleCond=strRuleCond+getGroupCond(childLogicLinkCond)>//getGroupCond
<#else>
<#assign strRuleCond=strRuleCond+getFieldCond(childLogicLinkCond)>//getFieldCond
</#if>
<#if childLogicLinkCond_has_next>
<#assign strRuleCond=strRuleCond+LogicLinkCond.getGroupOP()?replace("AND","&&")?replace("OR","||")>//拼接连接符
</#if>
</#list>
</#if>
<#assign strRuleCond=strRuleCond+")">
<#return strRuleCond/>
</#function>
<#comment>获取单项条件表达式</#comment>
<#function getFieldCond LogicLinkCond>
<#assign fieldCond="(" >
<#assign condBody="">
<#assign targetParam=LogicLinkCond.getDstLogicParam()><#comment>目标参数</#comment>
<#assign targetFieldName=LogicLinkCond.getDstFieldName()><#comment>目标属性名称</#comment>
<#assign targetDEField=((targetParam.getParamPSDataEntity().getPSDEField(targetFieldName,true))!'')><#comment>目标属性</#comment>
<#assign targetDBValueOP=LogicLinkCond.getPSDBValueOPId()><#comment>表达式</#comment>
<#assign targetValue=LogicLinkCond.getValue()><#comment>值项</#comment>
<#if targetDEField!=''>
<#assign targetFieldName=srfr7templcaseformat(targetDEField.codeName)>
</#if>
<#assign condBody="RuleUtils.test($"+logicName+targetParam.getCodeName()?lower_case+".get(\""+targetFieldName+"\"),\""+targetDBValueOP+"\","+"\""+targetValue+"\")">
<#assign fieldCond=fieldCond+condBody >
<#assign fieldCond=fieldCond+")" >
<#return fieldCond/>
</#function>
<#comment>获取conditionExpression</#comment>
<#function getConditionExpression LogicParams>
<#assign expressionCond="" >
<#list LogicParams.getPSDELogicParams() as logicParam>
<#assign condBody="">
<#if logicParam.getParamPSDataEntity?? && logicParam.getParamPSDataEntity()??>
<#assign condBody='$'+logicName+logicParam.codeName?lower_case+'=='+logicName+logicParam.codeName?lower_case>
<#if logicParam_has_next>
<#assign condBody=condBody+" && ">
</#if>
<#else>
//暂未实现
</#if>
<#assign expressionCond=expressionCond+condBody >
</#list>
<#return expressionCond/>
</#function>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSDEACTION
</#ibiztemplate>
<#comment>引入驼峰配置</#comment>
<#ibizinclude>/SLN/globalfunc.cfg</#ibizinclude>
<#assign hasAfterLogic =false>
<#assign hasAfterDrl=false>
<#assign de=item.getPSDataEntity()>
<#if item.getAfterPSDEActionLogics?? && item.getAfterPSDEActionLogics()??>
<#list item.getAfterPSDEActionLogics() as afterlogic>
<#if afterlogic.isValid()==true>
<#if afterlogic.isInternalLogic() && afterlogic.getPSDELogic().isEnableBackend()>
<#assign hasAfterLogic=true>
<#elseif (afterlogic.getDstPSDE()!'')!='' && (afterlogic.getDstPSDEAction()!'')!='' && afterlogic.getDstPSDEAction().isEnableBackend()>
<#assign hasAfterLogic=true>
<#assign hasAfterDrl=true>
<#break >
</#if>
</#if>
</#list>
</#if>
<#if hasAfterLogic>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:g="http://www.jboss.org/drools/flow/gpd" xmlns:tns="http://www.jboss.org/drools" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.mvel.org/2.0" id="Definition" name="" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
<process id="${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.${de.codeName?lower_case}.${item.codeName?lower_case}.afterLogic" isClosed="false" isExecutable="true" name="${de.getPSSystemModule().codeName?lower_case}_${de.codeName?lower_case}_${item.codeName?lower_case}_afterLogic" processType="Private" tns:packageName="${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.${de.codeName?lower_case}.${item.codeName?lower_case}.afterLogic">
<extensionElements>
<tns:import name="java.util.Map"/>
<tns:import name="org.springframework.util.StringUtils"/>
<tns:import name="${pub.getPKGCodeName()}.util.helper.RuleUtils"/>
<tns:import name="${pub.getPKGCodeName()}.core.${de.getPSSystemModule().getCodeName()?lower_case}.domain.${de.getCodeName()}"/>
<#comment>插入服务对象</#comment>
<#list item.getAfterPSDEActionLogics() as afterlogic>
<#if (afterlogic.getDstPSDE()!'')!='' && (afterlogic.getDstPSDEAction()!'')!='' && afterlogic.getDstPSDEAction().isEnableBackend()>
<#assign dataentity = afterlogic.getDstPSDE()>
<#assign deaction = afterlogic.getDstPSDEAction()>
<#if !P.exists("refservice",dataentity+"service")>
<tns:metaData express="T(${pub.getPKGCodeName()}.util.security.SpringContextHolder).getBean(T(${pub.getPKGCodeName()}.core.${dataentity.getPSSystemModule().codeName?lower_case}.service.I${dataentity.codeName}Service))" name="${srfr7templcaseformat(dataentity.getCodeName())}Service" type="service"/>
</#if>
</#if>
</#list>
<#if hasAfterDrl>
<#comment>插入当前实体对象</#comment>
<tns:metaData express="" name="et" type="entity"/>
</#if>
</extensionElements>
<#if item.getAfterPSDEActionLogics?? && item.getAfterPSDEActionLogics()??>
<startEvent id="begin" isInterrupting="true"/>
<endEvent id="prepareparam1_end" name="end"/>
<#assign source="begin">
<#list item.getAfterPSDEActionLogics() as afterlogic>
<#if afterlogic.isValid()==true>
<#comment>实体行为附加逻辑</#comment>
<#if afterlogic.isInternalLogic() && afterlogic.getPSDELogic().isEnableBackend()>
<#assign delogic = afterlogic.getPSDELogic()>
<#assign target = afterlogic.getId()>
<callActivity activiti:exclusive="true" calledElement="${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.service.logic.${de.codeName?lower_case}${delogic.getCodeName()?lower_case}" id="${target}" name="${(de.codeName + delogic.codeName)+"RuleFlow.bpmn"}"/>
<#elseif afterlogic.getDstPSDEAction()?? && afterlogic.getDstPSDEAction().isEnableBackend()>
<#assign dataentity = afterlogic.getDstPSDE()>
<#assign deaction = afterlogic.getDstPSDEAction()>
<#assign target = afterlogic.getId()>
<#assign groupName = (dataentity.codeName + deaction.codeName)?lower_case>
<businessRuleTask activiti:exclusive="true" g:ruleFlowGroup="${target}" id="${target}" implementation="http://www.jboss.org/drools/rule" name="${groupName}"/>
</#if>
<sequenceFlow id="${source}_${target}" sourceRef="${source}" targetRef="${target}"/>
<#assign source = target>
<#if !afterlogic_has_next>
<sequenceFlow id="${source}_prepareparam1_end" sourceRef="${source}" targetRef="prepareparam1_end"/>
</#if>
</#if>
</#list>
</#if>
</process>
</definitions>
</#if>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSDEACTION
</#ibiztemplate>
<#comment>引入驼峰配置</#comment>
<#ibizinclude>/SLN/globalfunc.cfg</#ibizinclude>
<#comment>实体行为调用实体行为</#comment>
<#assign hasAfterLogic =false>
<#assign de=item.getPSDataEntity()>
<#if item.getAfterPSDEActionLogics?? && item.getAfterPSDEActionLogics()??>
<#list item.getAfterPSDEActionLogics() as afterlogic>
<#if afterlogic.isValid()==true>
<#if (afterlogic.getDstPSDE()!'')!='' && (afterlogic.getDstPSDEAction()!'')!='' && afterlogic.getDstPSDEAction().isEnableBackend()>
<#assign hasAfterLogic=true>
<#assign dataentity = afterlogic.getDstPSDE()>
<#if !P.exists("refservice",dataentity+"service")>
global ${pub.getPKGCodeName()}.core.${dataentity.getPSSystemModule().codeName?lower_case}.service.I${dataentity.codeName}Service ${srfr7templcaseformat(dataentity.getCodeName())}Service;
</#if>
</#if>
</#if>
</#list>
</#if>
<#if hasAfterLogic>
import ${pub.getPKGCodeName()}.util.helper.CachedBeanCopier;
global ${pub.getPKGCodeName()}.core.${de.getPSSystemModule().getCodeName()?lower_case}.domain.${de.getCodeName()} et;
<#if item.getAfterPSDEActionLogics?? && item.getAfterPSDEActionLogics()??>
no-loop
<#list item.getAfterPSDEActionLogics() as afterlogic>
<#comment>实体行为附加逻辑</#comment>
<#if afterlogic.isValid()==true && afterlogic.getDstPSDEAction()?? && afterlogic.getDstPSDEAction().isEnableBackend()>
<#assign dataentity = afterlogic.getDstPSDE()>
<#assign deaction = afterlogic.getDstPSDEAction()>
<#assign dataentityCodeName = afterlogic.getDstPSDE().codeName>
<#assign deactionCodeName = srfmethodname(afterlogic.getDstPSDEAction().codeName)>
<#assign groupName = (dataentity.codeName + deaction.codeName)?lower_case>
<#assign target = afterlogic.getId()>
rule "${groupName}"
ruleflow-group "${target}"
when
then
<@addActionLogic deaction afterlogic/>
end
</#if>
</#list>
</#if>
</#if>
<#comment>附加实体行为</#comment>
<#macro addActionLogic deaction actionlogic>
<#assign actionLogicDE=actionlogic.getDstPSDE()>
<#assign actionLogicDEAction=actionlogic.getDstPSDEAction()>
<#assign sourceActionType=deaction.getActionType()>
<#assign sourceCodeName=deaction.getCodeName()?lower_case>
<#assign targetActionType=actionLogicDEAction.getActionType()>
<#assign targetCodeName=actionLogicDEAction.getCodeName()?lower_case>
<#if ((sourceActionType=='USERCUSTOM')|| sourceActionType=='DELOGIC'|| sourceCodeName == "create" || sourceCodeName == "update" ||
sourceCodeName == "save" || sourceCodeName == "getdraft" || sourceCodeName == "checkkey") &&
((targetActionType=='USERCUSTOM')|| targetActionType=='DELOGIC'|| targetCodeName == "create" || targetCodeName == "update" ||
targetCodeName == "save" || targetCodeName == "getdraft" || targetCodeName == "checkkey")>
<#if actionlogic.isIgnoreException()?? && actionlogic.isIgnoreException()==true>
try {
<@actionLogic_entity actionlogic/>
}
catch(Exception e) {
log.error("执行[${srfmethodname(actionLogicDEAction.getCodeName())}]行为附加逻辑发生异常");
}
<#else>
<@actionLogic_entity actionlogic/>
</#if>
<#elseif sourceCodeName=='remove' && targetCodeName == "remove">
<#if actionlogic.isIgnoreException()?? && actionlogic.isIgnoreException()==true>
try {
<@actionLogic_remove actionlogic/>
}
catch(Exception e) {
log.error("执行[${srfmethodname(actionLogicDEAction.getCodeName())}]行为附加逻辑发生异常");
}
<#else>
<@actionLogic_remove actionlogic/>
</#if>
</#if>
</#macro>
<#comment>实体行为附加逻辑-参数:实体</#comment>
<#macro actionLogic_entity actionlogic>
<#assign actionLogicDE=actionlogic.getDstPSDE()>
<#assign actionLogicDEAction=actionlogic.getDstPSDEAction()>
${pub.getPKGCodeName()}.core.${actionLogicDE.getPSSystemModule().getCodeName()?lower_case}.domain.${actionLogicDE.getCodeName()} actionLogicDE =new ${pub.getPKGCodeName()}.core.${actionLogicDE.getPSSystemModule().getCodeName()?lower_case}.domain.${actionLogicDE.getCodeName()}();
CachedBeanCopier.copy(et, actionLogicDE);
${srfcaseformat(actionLogicDE.getCodeName(),'l_u2lC')}Service.${srfmethodname(actionLogicDEAction.getCodeName())}(actionLogicDE);
</#macro>
<#comment>实体行为附加逻辑-remove</#comment>
<#macro actionLogic_remove actionlogic>
<#if de.getKeyPSDEField().getStdDataType()==actionLogicDE.getKeyPSDEField().getStdDataType()>
<#assign privateCodeName = srfr7templcaseformat(de.getKeyPSDEField().getCodeName()) >
<#assign publicCodeName = privateCodeName?cap_first >
${srfr7templcaseformat(actionLogicDE.getCodeName())}Service.remove(et.get${publicCodeName}());
</#if>
</#macro>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSDEACTION
</#ibiztemplate>
<#comment>引入驼峰配置</#comment>
<#ibizinclude>/SLN/globalfunc.cfg</#ibizinclude>
<#assign hasBeforeLogic =false>
<#assign hasBeforeDrl=false>
<#assign de=item.getPSDataEntity()>
<#if item.getBeforePSDEActionLogics?? && item.getBeforePSDEActionLogics()??>
<#list item.getBeforePSDEActionLogics() as beforelogic>
<#if beforelogic.isValid()==true>
<#if beforelogic.isInternalLogic() && beforelogic.getPSDELogic().isEnableBackend()>
<#assign hasBeforeLogic=true>
<#elseif (beforelogic.getDstPSDE()!'')!='' && (beforelogic.getDstPSDEAction()!'')!='' && beforelogic.getDstPSDEAction().isEnableBackend()>
<#assign hasBeforeLogic=true>
<#assign hasBeforeDrl=true>
<#break>
</#if>
</#if>
</#list>
</#if>
<#if hasBeforeLogic>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:g="http://www.jboss.org/drools/flow/gpd" xmlns:tns="http://www.jboss.org/drools" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.mvel.org/2.0" id="Definition" name="" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
<process id="${pub.getPKGCodeName()}.core.extensions.service.logic.before" isClosed="false" isExecutable="true" name="${de.getPSSystemModule().codeName?lower_case}_${de.codeName?lower_case}_${item.codeName?lower_case}_beforeLogic" processType="Private" tns:packageName="${pub.getPKGCodeName()}.core.extensions.service.logic.before">
<extensionElements>
<tns:import name="java.util.Map"/>
<tns:import name="org.springframework.util.StringUtils"/>
<tns:import name="${pub.getPKGCodeName()}.util.helper.RuleUtils"/>
<tns:import name="${pub.getPKGCodeName()}.core.${de.getPSSystemModule().getCodeName()?lower_case}.domain.${de.getCodeName()}"/>
<#comment>插入服务对象</#comment>
<#list item.getBeforePSDEActionLogics() as beforelogic>
<#if (beforelogic.getDstPSDE()!'')!='' && (beforelogic.getDstPSDEAction()!'')!='' && beforelogic.getDstPSDEAction().isEnableBackend()>
<#assign dataentity = beforelogic.getDstPSDE()>
<#assign deaction = beforelogic.getDstPSDEAction()>
<#if !P.exists("refservice",dataentity+"service")>
<tns:metaData express="T(${pub.getPKGCodeName()}.util.security.SpringContextHolder).getBean(T(${pub.getPKGCodeName()}.core.${dataentity.getPSSystemModule().codeName?lower_case}.service.I${dataentity.codeName}Service))" name="${srfr7templcaseformat(dataentity.getCodeName())}Service" type="service"/>
</#if>
</#if>
</#list>
<#if hasBeforeDrl>
<#comment>插入当前实体对象</#comment>
<tns:metaData express="" name="et" type="entity"/>
</#if>
</extensionElements>
<#if item.getBeforePSDEActionLogics?? && item.getBeforePSDEActionLogics()??>
<startEvent id="begin" isInterrupting="true"/>
<endEvent id="prepareparam1_end" name="end"/>
<#assign source="begin">
<#list item.getBeforePSDEActionLogics() as beforelogic>
<#if beforelogic.isValid()==true>
<#comment>实体行为附加逻辑</#comment>
<#if beforelogic.isInternalLogic() && beforelogic.getPSDELogic().isEnableBackend()>
<#assign delogic = beforelogic.getPSDELogic()>
<#assign target =beforelogic.getId()>
<callActivity activiti:exclusive="true" calledElement="${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.service.logic.${de.codeName?lower_case}${delogic.getCodeName()?lower_case}" id="${target}" name="${(de.codeName + delogic.codeName)+"RuleFlow.bpmn"}"/>
<#elseif beforelogic.getDstPSDEAction()?? && beforelogic.getDstPSDEAction().isEnableBackend()>
<#assign dataentity = beforelogic.getDstPSDE()>
<#assign deaction = beforelogic.getDstPSDEAction()>
<#assign target = beforelogic.getId()>
<#assign groupName = (dataentity.codeName + deaction.codeName)?lower_case>
<businessRuleTask activiti:exclusive="true" g:ruleFlowGroup="${target}" id="${target}" implementation="http://www.jboss.org/drools/rule" name="${groupName}"/>
</#if>
<sequenceFlow id="${source}_${target}" sourceRef="${source}" targetRef="${target}"/>
<#assign source = target>
<#if !beforelogic_has_next>
<sequenceFlow id="${source}_prepareparam1_end" sourceRef="${source}" targetRef="prepareparam1_end"/>
</#if>
</#if>
</#list>
</#if>
</process>
</definitions>
</#if>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSDEACTION
</#ibiztemplate>
<#comment>引入驼峰配置</#comment>
<#ibizinclude>/SLN/globalfunc.cfg</#ibizinclude>
<#comment>实体行为调用实体行为</#comment>
<#assign hasBeforeLogic =false>
<#assign de=item.getPSDataEntity()>
<#if item.getBeforePSDEActionLogics?? && item.getBeforePSDEActionLogics()??>
<#list item.getBeforePSDEActionLogics() as beforelogic>
<#if beforelogic.isValid()==true>
<#if (beforelogic.getDstPSDE()!'')!='' && (beforelogic.getDstPSDEAction()!'')!='' && beforelogic.getDstPSDEAction().isEnableBackend()>
<#assign hasBeforeLogic=true>
<#assign dataentity = beforelogic.getDstPSDE()>
<#if !P.exists("refservice",dataentity+"service")>
global ${pub.getPKGCodeName()}.core.${dataentity.getPSSystemModule().codeName?lower_case}.service.I${dataentity.codeName}Service ${srfr7templcaseformat(dataentity.getCodeName())}Service;
</#if>
</#if>
</#if>
</#list>
</#if>
<#if hasBeforeLogic>
import ${pub.getPKGCodeName()}.util.helper.CachedBeanCopier;
global ${pub.getPKGCodeName()}.core.${de.getPSSystemModule().getCodeName()?lower_case}.domain.${de.getCodeName()} et;
<#if item.getBeforePSDEActionLogics?? && item.getBeforePSDEActionLogics()??>
no-loop
<#list item.getBeforePSDEActionLogics() as beforelogic>
<#comment>实体行为附加逻辑</#comment>
<#if beforelogic.isValid()==true && beforelogic.getDstPSDEAction()?? && beforelogic.getDstPSDEAction().isEnableBackend()>
<#assign dataentity = beforelogic.getDstPSDE()>
<#assign deaction = beforelogic.getDstPSDEAction()>
<#assign dataentityCodeName = beforelogic.getDstPSDE().codeName>
<#assign deactionCodeName = srfmethodname(beforelogic.getDstPSDEAction().codeName)>
<#assign groupName = (dataentity.codeName + deaction.codeName)?lower_case>
<#assign target = beforelogic.getId()>
rule "${groupName}"
ruleflow-group "${target}"
when
then
<@addActionLogic deaction beforelogic/>
end
</#if>
</#list>
</#if>
</#if>
<#comment>附加实体行为</#comment>
<#macro addActionLogic deaction actionlogic>
<#assign actionLogicDE=actionlogic.getDstPSDE()>
<#assign actionLogicDEAction=actionlogic.getDstPSDEAction()>
<#assign sourceActionType=deaction.getActionType()>
<#assign sourceCodeName=deaction.getCodeName()?lower_case>
<#assign targetActionType=actionLogicDEAction.getActionType()>
<#assign targetCodeName=actionLogicDEAction.getCodeName()?lower_case>
<#if ((sourceActionType=='USERCUSTOM')|| sourceActionType=='DELOGIC'|| sourceCodeName == "create" || sourceCodeName == "update" ||
sourceCodeName == "save" || sourceCodeName == "getdraft" || sourceCodeName == "checkkey") &&
((targetActionType=='USERCUSTOM')|| targetActionType=='DELOGIC'|| targetCodeName == "create" || targetCodeName == "update" ||
targetCodeName == "save" || targetCodeName == "getdraft" || targetCodeName == "checkkey")>
<#if actionlogic.isIgnoreException()?? && actionlogic.isIgnoreException()==true>
try {
<@actionLogic_entity actionlogic/>
}
catch(Exception e) {
log.error("执行[${srfmethodname(actionLogicDEAction.getCodeName())}]行为附加逻辑发生异常");
}
<#else>
<@actionLogic_entity actionlogic/>
</#if>
<#elseif sourceCodeName=='remove' && targetCodeName == "remove">
<#if actionlogic.isIgnoreException()?? && actionlogic.isIgnoreException()==true>
try {
<@actionLogic_remove actionlogic/>
}
catch(Exception e) {
log.error("执行[${srfmethodname(actionLogicDEAction.getCodeName())}]行为附加逻辑发生异常");
}
<#else>
<@actionLogic_remove actionlogic/>
</#if>
</#if>
</#macro>
<#comment>实体行为附加逻辑-参数:实体</#comment>
<#macro actionLogic_entity actionlogic>
<#assign actionLogicDE=actionlogic.getDstPSDE()>
<#assign actionLogicDEAction=actionlogic.getDstPSDEAction()>
${pub.getPKGCodeName()}.core.${actionLogicDE.getPSSystemModule().getCodeName()?lower_case}.domain.${actionLogicDE.getCodeName()} actionLogicDE =new ${pub.getPKGCodeName()}.core.${actionLogicDE.getPSSystemModule().getCodeName()?lower_case}.domain.${actionLogicDE.getCodeName()}();
CachedBeanCopier.copy(et, actionLogicDE);
${srfcaseformat(actionLogicDE.getCodeName(),'l_u2lC')}Service.${srfmethodname(actionLogicDEAction.getCodeName())}(actionLogicDE);
</#macro>
<#comment>实体行为附加逻辑-remove</#comment>
<#macro actionLogic_remove actionlogic>
<#if de.getKeyPSDEField().getStdDataType()==actionLogicDE.getKeyPSDEField().getStdDataType()>
<#assign privateCodeName = srfr7templcaseformat(de.getKeyPSDEField().getCodeName()) >
<#assign publicCodeName = privateCodeName?cap_first >
${srfr7templcaseformat(actionLogicDE.getCodeName())}Service.remove(et.get${publicCodeName}());
</#if>
</#macro>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSDEACTION
</#ibiztemplate>
<#if item.getActionType()=='DELOGIC' && item.getPSDELogic()?? && item.getPSDELogic().isEnableBackend()>
<#assign de=item.getPSDataEntity()>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:g="http://www.jboss.org/drools/flow/gpd" xmlns:tns="http://www.jboss.org/drools" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.mvel.org/2.0" id="Definition" name="" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
<process id="${pub.getPKGCodeName()}.core.extensions.service.logic.execute" isClosed="false" isExecutable="true" name="${de.getPSSystemModule().codeName?lower_case}_${de.codeName?lower_case}_${item.codeName?lower_case}.execLogic" processType="Private" tns:packageName="${pub.getPKGCodeName()}.core.extensions.service.logic.execute">
<extensionElements>
<tns:import name="java.util.Map"/>
<tns:import name="org.springframework.util.StringUtils"/>
<tns:import name="${pub.getPKGCodeName()}.util.helper.RuleUtils"/>
</extensionElements>
<#comment>实体行为附加逻辑</#comment>
<#assign delogic = item.getPSDELogic()>
<#assign source="begin">
<#assign action=item.getPSDELogic()>
<startEvent id="begin" isInterrupting="true"/>
<endEvent id="prepareparam1_end" name="end"/>
<#assign target = action.getCodeName()>
<callActivity activiti:exclusive="true" calledElement="${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.service.logic.${de.codeName?lower_case}${delogic.getCodeName()?lower_case}" id="${target}" name="${(de.codeName + delogic.codeName)+"RuleFlow.bpmn"}"/>
<sequenceFlow id="${source}_${target}" sourceRef="${source}" targetRef="${target}"/>
<#assign source = target>
<sequenceFlow id="${source}_${target}" sourceRef="${source}" targetRef="prepareparam1_end"/>
</process>
</definitions>
</#if>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册