提交 8ebafe95 编写于 作者: sq3536's avatar sq3536

init

上级 0657377d
<#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 && afterlogic.getActionLogicType()?c!='2'>
<#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 ${srfcaseformat(dataentity.getCodeName(),'l_u2lC')}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>
global ${pub.getPKGCodeName()}.core.${de.getPSSystemModule().getCodeName()?lower_case}.domain.${de.getCodeName()} et;
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
no-loop
<#list item.getAfterPSDEActionLogics() as afterlogic>
<#comment>实体行为附加逻辑</#comment>
<#if afterlogic.isValid()==true && afterlogic.getActionLogicType()?c!='2' && afterlogic.getDstPSDEAction()?? && afterlogic.getDstPSDEAction().isEnableBackend()>
<#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
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()>
......@@ -49,28 +53,28 @@
<#assign sourceCodeName=deaction.getCodeName()?lower_case>
<#assign targetActionType=actionLogicDEAction.getActionType()>
<#assign targetCodeName=actionLogicDEAction.getCodeName()?lower_case>
<#if ((sourceActionType=='SCRIPT')|| (sourceActionType=='USERCUSTOM')|| sourceActionType=='DELOGIC'|| sourceCodeName == "create" || sourceCodeName == "update" ||
<#if ((sourceActionType=='USERCUSTOM')|| sourceActionType=='DELOGIC'|| sourceCodeName == "create" || sourceCodeName == "update" ||
sourceCodeName == "save" || sourceCodeName == "getdraft" || sourceCodeName == "checkkey") &&
((targetActionType=='SCRIPT')|| (targetActionType=='USERCUSTOM')|| targetActionType=='DELOGIC'|| targetCodeName == "create" || targetCodeName == "update" ||
((targetActionType=='USERCUSTOM')|| targetActionType=='DELOGIC'|| targetCodeName == "create" || targetCodeName == "update" ||
targetCodeName == "save" || targetCodeName == "getdraft" || targetCodeName == "checkkey")>
<#if actionlogic.isIgnoreException()?? && actionlogic.isIgnoreException()==true>
try {
try {
<@actionLogic_entity actionlogic/>
}
catch(Exception e) {
}
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 {
try {
<@actionLogic_remove actionlogic/>
}
catch(Exception e) {
}
catch(Exception e) {
log.error("执行[${srfmethodname(actionLogicDEAction.getCodeName())}]行为附加逻辑发生异常");
}
}
<#else>
<@actionLogic_remove actionlogic/>
</#if>
......@@ -82,15 +86,15 @@
<#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()}();
et.copyTo(actionLogicDE,true);
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 = srfcaseformat(de.getKeyPSDEField().getCodeName(),'l_u2lC') >
<#assign privateCodeName = srfr7templcaseformat(de.getKeyPSDEField().getCodeName()) >
<#assign publicCodeName = privateCodeName?cap_first >
${srfcaseformat(actionLogicDE.getCodeName(),'l_u2lC')}Service.remove(et.get${publicCodeName}());
${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>
<#comment>实体行为调用实体行为</#comment>
<#assign hasBeforeLogic =false>
<#assign de=item.getPSDataEntity()>
<#if item.getBeforePSDEActionLogics?? && item.getBeforePSDEActionLogics()??>
<#list item.getBeforePSDEActionLogics() as beforelogic>
<#if beforelogic.isValid()==true && beforelogic.getActionLogicType()?c!='2'>
<#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 ${srfcaseformat(dataentity.getCodeName(),'l_u2lC')}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>
global ${pub.getPKGCodeName()}.core.${de.getPSSystemModule().getCodeName()?lower_case}.domain.${de.getCodeName()} et;
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
no-loop
<#list item.getBeforePSDEActionLogics() as beforelogic>
<#comment>实体行为附加逻辑</#comment>
<#if beforelogic.isValid()==true && beforelogic.getActionLogicType()?c!='2' && beforelogic.getDstPSDEAction()?? && beforelogic.getDstPSDEAction().isEnableBackend()>
<#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
rule "${groupName}"
ruleflow-group "${target}"
when
then
<@addActionLogic deaction beforelogic/>
end
</#if>
</#list>
</#if>
......@@ -48,28 +53,28 @@
<#assign sourceCodeName=deaction.getCodeName()?lower_case>
<#assign targetActionType=actionLogicDEAction.getActionType()>
<#assign targetCodeName=actionLogicDEAction.getCodeName()?lower_case>
<#if ((sourceActionType=='SCRIPT')|| (sourceActionType=='USERCUSTOM')|| sourceActionType=='DELOGIC'|| sourceCodeName == "create" || sourceCodeName == "update" ||
<#if ((sourceActionType=='USERCUSTOM')|| sourceActionType=='DELOGIC'|| sourceCodeName == "create" || sourceCodeName == "update" ||
sourceCodeName == "save" || sourceCodeName == "getdraft" || sourceCodeName == "checkkey") &&
((targetActionType=='SCRIPT')|| (targetActionType=='USERCUSTOM')|| targetActionType=='DELOGIC'|| targetCodeName == "create" || targetCodeName == "update" ||
((targetActionType=='USERCUSTOM')|| targetActionType=='DELOGIC'|| targetCodeName == "create" || targetCodeName == "update" ||
targetCodeName == "save" || targetCodeName == "getdraft" || targetCodeName == "checkkey")>
<#if actionlogic.isIgnoreException()?? && actionlogic.isIgnoreException()==true>
try {
try {
<@actionLogic_entity actionlogic/>
}
catch(Exception e) {
}
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 {
try {
<@actionLogic_remove actionlogic/>
}
catch(Exception e) {
}
catch(Exception e) {
log.error("执行[${srfmethodname(actionLogicDEAction.getCodeName())}]行为附加逻辑发生异常");
}
}
<#else>
<@actionLogic_remove actionlogic/>
</#if>
......@@ -81,15 +86,15 @@
<#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()}();
et.copyTo(actionLogicDE,true);
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 = srfcaseformat(de.getKeyPSDEField().getCodeName(),'l_u2lC') >
<#assign privateCodeName = srfr7templcaseformat(de.getKeyPSDEField().getCodeName()) >
<#assign publicCodeName = privateCodeName?cap_first >
${srfcaseformat(actionLogicDE.getCodeName(),'l_u2lC')}Service.remove(et.get${publicCodeName}());
${srfr7templcaseformat(actionLogicDE.getCodeName())}Service.remove(et.get${publicCodeName}());
</#if>
</#macro>
\ No newline at end of file
<#if item.getActionType()=='DELOGIC' && item.getPSDELogic()?? && item.getPSDELogic().isEnableBackend() && item.getPSDELogic().isCustomCode()== false>
<#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>
<#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"/>
<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="${delogic.codeName}.json.bpmn"/>
<sequenceFlow id="${source}_${target}" sourceRef="${source}" targetRef="${target}"/>
<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>
\ No newline at end of file
<sequenceFlow id="${source}_${target}" sourceRef="${source}" targetRef="prepareparam1_end"/>
</process>
</definitions>
</#if>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册