{{#if entityAction.hasBeforeLogics}}
<?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="{{packageName}}.core.{{entityAction.entity.module}}.{{lowerCase entityAction.entity.codeName}}.{{lowerCase entityAction.codeName}}.beforeLogic" isClosed="false" isExecutable="true"
             name="{{entityAction.entity.module}}_{{lowerCase entityAction.entity.codeName}}_{{lowerCase entityAction.codeName}}_beforeLogic" processType="Private"
             tns:packageName="{{packageName}}.core.{{entityAction.entity.module}}.{{lowerCase entityAction.entity.codeName}}.{{lowerCase entityAction.codeName}}.beforeLogic">
        <extensionElements>
            <tns:import name="java.util.Map"/>
            <tns:import name="org.springframework.util.StringUtils"/>
            <tns:import name="cn.ibizlab.util.helper.RuleUtils"/>
            <tns:import name="{{packageName}}.core.{{entityAction.entity.module}}.domain.{{entityAction.entity.codeName}}"/>
            {{#each entityAction.beforeLogicParams as |beforeLogicParam|}}
            {{beforeLogicParam}}
            {{/each}}
        </extensionElements>

        <startEvent id="begin" isInterrupting="true"/>
        <endEvent id="prepareparam1_end" name="end"/>
        {{#each entityAction.beforeActionLogics as |logicModel|}}
            {{#if logicModel.pSDEActionLogic.pSDELogic}}
        <callActivity activiti:exclusive="true" calledElement="{{packageName}}.core.{{entityAction.entity.module}}.service.logic.{{lowerCase entityAction.entity.codeName}}{{lowerCase logicModel.pSDEActionLogic.pSDELogic.codeName}}" id="{{logicModel.id}}" name="{{entityAction.entity.codeName}}/{{logicModel.pSDEActionLogic.pSDELogic.codeName}}RuleFlow.bpmn"/>
            {{/if}}
            {{#if logicModel.pSDEActionLogic.dstPSDEAction}}
        <businessRuleTask activiti:exclusive="true" g:ruleFlowGroup="{{logicModel.id}}" id="{{logicModel.id}}" implementation="http://www.jboss.org/drools/rule" name="{{lowerCase logicModel.pSDEActionLogic.dstPSDE.codeName}}{{lowerCase logicModel.pSDEActionLogic.dstPSDEAction.codeName}}"/>
            {{/if}}
        {{/each}}

        {{#each entityAction.beforeLogicSequenceFlows as |beforeLogicSequenceFlow|}}
        {{beforeLogicSequenceFlow}}
        {{/each}}

    </process>
</definitions>
{{/if}}