{{#if entityAction.hasBeforeLogicsDEAction}}
import cn.ibizlab.util.helper.CachedBeanCopier;
global {{packageName}}.core.{{entityAction.entity.module}}.domain.{{entityAction.entity.codeName}} et;
{{#each entityAction.beforeGlobalParams as |beforeGlobalParam|}}
{{beforeGlobalParam}}
{{/each}}

no-loop
{{#each entityAction.beforeActionLogics as |logicModel|}}

{{#if logicModel.pSDEActionLogic.dstPSDEAction}}
rule "{{lowerCase logicModel.pSDEActionLogic.dstPSDE.codeName}}{{lowerCase logicModel.pSDEActionLogic.dstPSDEAction.codeName}}"
ruleflow-group "{{logicModel.id}}"
when
then

{{#if ogicModel.pSDEActionLogic.isIgnoreException}}
    try{
{{/if}}
{{#if (or (eq logicModel.pSDEActionLogic.dstPSDEAction.actionType 'USERCUSTOM') (eq logicModel.pSDEActionLogic.dstPSDEAction.actionType 'DELOGIC') (eq logicModel.pSDEActionLogic.dstPSDEAction.codeName 'Create') (eq logicModel.pSDEActionLogic.dstPSDEAction.codeName 'Update') (eq logicModel.pSDEActionLogic.dstPSDEAction.codeName 'Save') (eq logicModel.pSDEActionLogic.dstPSDEAction.codeName 'GetDraft') (eq logicModel.pSDEActionLogic.dstPSDEAction.codeName 'CheckKey'))}}
        {{packageName}}.core.{{lowerCase logicModel.pSDEActionLogic.dstPSDE.pSSystemModule.codeName}}.domain.{{logicModel.pSDEActionLogic.dstPSDE.codeName}} actionLogicDE =new {{packageName}}.core.{{lowerCase logicModel.pSDEActionLogic.dstPSDE.pSSystemModule.codeName}}.domain.{{logicModel.pSDEActionLogic.dstPSDE.codeName}}();
        CachedBeanCopier.copy(et, actionLogicDE);
        {{lowerCase logicModel.pSDEActionLogic.dstPSDE.codeName}}Service.{{camelCase logicModel.pSDEActionLogic.dstPSDEAction.codeName}}(actionLogicDE);

{{else}}
    {{#if (eq logicModel.pSDEActionLogic.dstPSDEAction.codeName 'Remove')}}
        {{lowerCase logicModel.pSDEActionLogic.dstPSDE.codeName}}Service.remove(et.get{{pascalCase logicModel.pSDEActionLogic.dstPSDE.keyPSDEField.codeName}}());
    {{/if}}
{{/if}}
{{#if ogicModel.pSDEActionLogic.isIgnoreException}}
    }catch(Exception e) {
        log.error("执行[{{logicModel.pSDEActionLogic.dstPSDEAction}}]行为附加逻辑发生异常");
    }
{{/if}}
end
{{/if}}
{{/each}}


{{/if}}