<?xml version="1.0" encoding="UTF-8"?>
<process xmlns:bean="http://bean.boe.com/" xmlns:bpel="http://bpel.boe.com/" targetNamespace="http://bpel.boe.com/bpelj/" name="MDLReturnMaterialSendReport.bpel">
    <partnerLinks>
        <partnerLink name="bpelj" partnerLinkType="bpel:bpelj" />
        <partnerLink name="EventInfoUtil" partnerLinkType="bean:EventInfoUtil" />
        <partnerLink name="TransactionUtil" partnerLinkType="bean:TransactionUtil" />
        <partnerLink name="MaterialShipRequestServiceImpl" partnerLinkType="bean:MaterialShipRequestServiceImpl" />
        <partnerLink name="CommonValidation" partnerLinkType="bean:CommonValidation" />
    </partnerLinks>
    <variables>
        <variable name="B17" messageType="java.lang.String"></variable>
        <variable name="charge" messageType="java.lang.String"></variable>
        <variable name="checkResult" messageType="java.lang.String"></variable>
        <variable name="DeleteMDLRequestMaterialSend" messageType="java.lang.String"></variable>
        <variable name="description" messageType="java.lang.String"></variable>
        <variable name="erpFactory" messageType="java.lang.String"></variable>
        <variable name="erpLocation" messageType="java.lang.String"></variable>
        <variable name="error" messageType="java.lang.Exception"></variable>
        <variable name="eventInfo" messageType="com.cim.idm.framework.data.EventInfo"></variable>
        <variable name="eventUser" messageType="java.lang.String" expression="getXmlData('ReturnMaterialSendReport', '//Message/Header/EVENTUSER')" />
        <variable name="expiringDate" messageType="java.lang.String"></variable>
        <variable name="flag" messageType="java.lang.String"></variable>
        <variable name="line" messageType="java.lang.String"></variable>
        <variable name="makeDate" messageType="java.lang.String"></variable>
        <variable name="materialElement" messageType="org.jdom.Element"></variable>
        <variable name="materialList" messageType="java.util.List"></variable>
        <variable name="materialQuantity" messageType="java.lang.String"></variable>
        <variable name="materialSpecName" messageType="java.lang.String"></variable>
        <variable name="MDLMES" messageType="java.lang.String"></variable>
        <variable name="MDLRequestMaterialSendReport" messageType="java.lang.String"></variable>
        <variable name="MES" messageType="java.lang.String"></variable>
        <variable name="reasonCode" messageType="java.lang.String"></variable>
        <variable name="reasonCodeType" messageType="java.lang.String"></variable>
        <variable name="receiveLocation" messageType="java.lang.String"></variable>
        <variable name="receiver" messageType="java.lang.String" expression="getXmlData('ReturnMaterialSendReport', '//Message/Body/RECEIVER')" />
        <variable name="remark" messageType="java.lang.String"></variable>
        <variable name="replySubjectName" messageType="java.lang.String" expression="getXmlData('ReturnMaterialSendReport', '//Message/Header/ORIGINALSOURCESUBJECTNAME')" />
        <variable name="ReturnMaterialSendReport" messageType="org.jdom.Document"></variable>
        <variable name="returnType" messageType="java.lang.String"></variable>
        <variable name="rtShipRequestDetailName" messageType="java.lang.String"></variable>
        <variable name="rtShipRequestName" messageType="java.lang.String" expression="getXmlData('ReturnMaterialSendReport', '//Message/Body/SHIPREQUESTNAME')" />
        <variable name="rtTime" messageType="java.lang.String" expression="getXmlData('ReturnMaterialSendReport', '//Message/Body/SHIPTIME')" />
        <variable name="rtTypeDescription" messageType="java.lang.String"></variable>
        <variable name="shipRequestName" messageType="java.lang.String"></variable>
        <variable name="supplierName" messageType="java.lang.String"></variable>
        <variable name="supplierNO" messageType="java.lang.String"></variable>
        <variable name="toMESMessage" messageType="org.jdom.Document"></variable>
        <variable name="woElement" messageType="org.jdom.Element"></variable>
        <variable name="workOrder" messageType="java.lang.String"></variable>
        <variable name="workOrderList" messageType="java.util.List"></variable>
        <variable name="workOrderType" messageType="java.lang.String"></variable>
    </variables>
    <sequence>
        <receive name="MDLReturnMaterialSendReport" bounds="166,30,149,62">
            <input variable="ReturnMaterialSendReport" type="org.jdom.Document" />
        </receive>
        <expression name="expression" type="expression" bounds="170,122,141,65">
            <source idx="0" terminal="5,A" />
            <function value="setVariable('workOrderList',getElementList('ReturnMaterialSendReport','//MATERIALLIST'))" />
            <function value="setVariable('workOrderType',getXmlData('ReturnMaterialSendReport','//WORKORDERTYPE'))" />
            <function value="setVariable('workOrder',getXmlData('ReturnMaterialSendReport','//WORKORDER'))" />
            <function value="setVariable('line',getXmlData('ReturnMaterialSendReport', '//LINE'))" />
            <function value="setVariable('reMark',getXmlData('ReturnMaterialSendReport', '//TEXT'))" />
            <function value="setVariable('flag',getXmlData('ReturnMaterialSendReport', '//FLAG'))" />
            <function value="setVariable('shipRequestName',getXmlData('ReturnMaterialSendReport', '//SHIPREQUESTNAME'))" />
        </expression>
        <switch name="switch" bounds="224,217,33,33" type="switch">
            <source idx="0" terminal="5,A" />
            <switchstart name="switchstart" type="switchstart" bounds="185,296,110,49">
                <source idx="0" terminal="5,A" />
            </switchstart>
            <case name="case" type="case" condition="getVariable('flag') = 'Y'" bounds="105,375,78,57">
                <source idx="0" terminal="5,A" />
                <invoke name="EventInfoUtil makeEventInfo" type="invokebean" description="public static com.cim.idm.framework.data.EventInfo makeEventInfo(java.lang.String eventName, java.lang.String eventUser, java.lang.String eventComment, java.lang.String reasonCodeType, java.lang.String reasonCode)" bounds="74,462,141,105" partnerLink="EventInfoUtil" partnerLinkType="EventInfoUtil" operation="makeEventInfo" operationDesc="public static com.cim.idm.framework.data.EventInfo makeEventInfo(java.lang.String eventName, java.lang.String eventUser, java.lang.String eventComment, java.lang.String reasonCodeType, java.lang.String reasonCode)" ignoreThrow="false" fork="false">
                    <source idx="0" terminal="5,A" />
                    <input constant="ReturnMaterialSendReport" type="java.lang.String" />
                    <input constant="MDLMES" type="java.lang.String" />
                    <input constant="ReturnMaterialSendReport" type="java.lang.String" />
                    <input variable="reasonCodeType" type="java.lang.String" />
                    <input variable="reasonCode" type="java.lang.String" />
                    <output variable="eventInfo" />
                </invoke>
                <invoke name="TransactionUtil beginTransaction" type="invokebean" description="public void beginTransaction()" bounds="74,597,141,105" partnerLink="TransactionUtil" partnerLinkType="TransactionUtil" operation="beginTransaction" operationDesc="public void beginTransaction()" ignoreThrow="false" fork="false">
                    <source idx="0" terminal="5,A" />
                </invoke>
                <while name="while" bounds="128,732,32,32" type="2" collection="workOrderList" element="woElement">
                    <source idx="0" terminal="5,A" />
                    <whilestart name="whilestart" type="whilestart" bounds="89,811,110,49">
                        <source idx="0" terminal="5,A" />
                    </whilestart>
                    <expression name="expression" type="expression" bounds="74,890,141,65">
                        <source idx="0" terminal="5,A" />
                        <function value="setVariable('materialList',getElementList('woElement','//MATERIAL'))" />
                    </expression>
                    <while name="while" bounds="128,985,32,32" type="2" collection="materialList" element="materialElement">
                        <source idx="0" terminal="5,A" />
                        <whilestart name="whilestart" type="whilestart" bounds="89,1064,110,49">
                            <source idx="0" terminal="5,A" />
                        </whilestart>
                        <expression name="expression" type="expression" bounds="74,1143,141,65">
                            <source idx="0" terminal="5,A" />
                            <function value="setVariable('materialSpecName',getXmlData('materialElement','//MATERIALSPECNAME'))" />
                            <function value="setVariable('materialQuantity',getXmlData('materialElement','//QUANTITY'))" />
                            <function value="setVariable('returnType',getXmlData('materialElement','//RETURNTYPE'))" />
                            <function value="setVariable('erpLocation',getXmlData('materialElement','//ERPLOCATION'))" />
                            <function value="setVariable('reasonCodeType',getXmlData('materialElement','//REASONCODETYPE'))" />
                            <function value="setVariable('reasonCode',getXmlData('materialElement','//REASONCODE'))" />
                            <function value="setVariable('rtTypeDescription',getXmlData('materialElement','//RETURNTYPEDESC'))" />
                            <function value="setVariable('rtShipRequestDetailName',getXmlData('materialElement','//MATERIALSPECNAME'))" />
                            <function value="setVariable('charge',getXmlData('materialElement','//CHARGE'))" />
                        </expression>
                        <invoke name="EventInfoUtil makeEventInfo" type="invokebean" description="public static com.cim.idm.framework.data.EventInfo makeEventInfo(java.lang.String eventName, java.lang.String eventUser, java.lang.String eventComment, java.lang.String reasonCodeType, java.lang.String reasonCode)" bounds="74,1238,141,105" partnerLink="EventInfoUtil" partnerLinkType="EventInfoUtil" operation="makeEventInfo" operationDesc="public static com.cim.idm.framework.data.EventInfo makeEventInfo(java.lang.String eventName, java.lang.String eventUser, java.lang.String eventComment, java.lang.String reasonCodeType, java.lang.String reasonCode)" ignoreThrow="false" fork="false">
                            <source idx="0" terminal="5,A" />
                            <input constant="ReturnMaterialSendReport" type="java.lang.String" />
                            <input constant="MES" type="java.lang.String" />
                            <input constant="ReturnMaterialSendReport" type="java.lang.String" />
                            <input variable="reasonCodeType" type="java.lang.String" />
                            <input variable="reasonCode" type="java.lang.String" />
                            <output variable="eventInfo" />
                        </invoke>
                        <invoke name="MaterialShipRequestServiceImpl saveMDLShipRequest" type="invokebean" description="public void saveMDLShipRequest(java.lang.String shipRequestName, java.lang.String shipRequestDetailName, java.lang.String erpFactory, java.lang.String erpLocation, com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String reasonCodeType, java.lang.String reasonCode, java.lang.String workOrder, java.lang.String materialSpecName, java.lang.String materialQuantity, java.lang.String charge, java.lang.String receiveLocation, java.lang.String receiver, java.lang.String shipTime, java.lang.String workOrderType, java.lang.String returnType, java.lang.String returnTypeDes, java.lang.String Line, java.lang.String reMark, java.lang.String supplierNO, java.lang.String systemType)" bounds="74,1373,141,105" partnerLink="MaterialShipRequestServiceImpl" partnerLinkType="MaterialShipRequestServiceImpl" operation="saveMDLShipRequest" operationDesc="public void saveMDLShipRequest(java.lang.String shipRequestName, java.lang.String shipRequestDetailName, java.lang.String erpFactory, java.lang.String erpLocation, com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String reasonCodeType, java.lang.String reasonCode, java.lang.String workOrder, java.lang.String materialSpecName, java.lang.String materialQuantity, java.lang.String charge, java.lang.String receiveLocation, java.lang.String receiver, java.lang.String shipTime, java.lang.String workOrderType, java.lang.String returnType, java.lang.String returnTypeDes, java.lang.String Line, java.lang.String reMark, java.lang.String supplierNO, java.lang.String systemType)" ignoreThrow="false" fork="false">
                            <source idx="0" terminal="5,A" />
                            <input variable="rtShipRequestName" type="java.lang.String" />
                            <input variable="rtShipRequestDetailName" type="java.lang.String" />
                            <input variable="erpFactory" type="java.lang.String" />
                            <input variable="erpLocation" type="java.lang.String" />
                            <input variable="eventInfo" type="com.cim.idm.framework.data.EventInfo" />
                            <input variable="reasonCodeType" type="java.lang.String" />
                            <input variable="reasonCode" type="java.lang.String" />
                            <input variable="workOrder" type="java.lang.String" />
                            <input variable="materialSpecName" type="java.lang.String" />
                            <input variable="materialQuantity" type="java.lang.String" />
                            <input variable="charge" type="java.lang.String" />
                            <input variable="receiveLocation" type="java.lang.String" />
                            <input variable="receiver" type="java.lang.String" />
                            <input variable="rtTime" type="java.lang.String" />
                            <input variable="workOrderType" type="java.lang.String" />
                            <input variable="returnType" type="java.lang.String" />
                            <input variable="rtTypeDescription" type="java.lang.String" />
                            <input variable="line" type="java.lang.String" />
                            <input variable="remark" type="java.lang.String" />
                            <input variable="supplierNO" type="java.lang.String" />
                            <input constant="MESSHIP" type="java.lang.String" />
                        </invoke>
                        <whileend name="whileend" type="whileend" bounds="89,1498,110,49">
                            <source idx="0" terminal="5,A" />
                        </whileend>
                    </while>
                    <whileend name="whileend" type="whileend" bounds="89,1567,110,49">
                        <source idx="0" terminal="5,A" />
                    </whileend>
                </while>
                <invoke name="TransactionUtil commitTransaction" type="invokebean" description="public void commitTransaction()" bounds="74,1646,141,105" partnerLink="TransactionUtil" partnerLinkType="TransactionUtil" operation="commitTransaction" operationDesc="public void commitTransaction()" ignoreThrow="false" fork="false">
                    <source idx="0" terminal="5,A" />
                </invoke>
                <terminate name="terminate" bounds="74,1781,141,65">
                    <source idx="0" terminal="5,A" />
                </terminate>
            </case>
            <case name="case" type="case" condition="getVariable('flag') = 'N'" bounds="411,375,62,45">
                <source idx="0" terminal="5,A" />
                <invoke name="EventInfoUtil makeEventInfo" type="invokebean" description="public static com.cim.idm.framework.data.EventInfo makeEventInfo(java.lang.String eventName, java.lang.String eventUser, java.lang.String eventComment, java.lang.String reasonCodeType, java.lang.String reasonCode)" bounds="372,450,141,105" partnerLink="EventInfoUtil" partnerLinkType="EventInfoUtil" operation="makeEventInfo" operationDesc="public static com.cim.idm.framework.data.EventInfo makeEventInfo(java.lang.String eventName, java.lang.String eventUser, java.lang.String eventComment, java.lang.String reasonCodeType, java.lang.String reasonCode)" ignoreThrow="false" fork="false">
                    <source idx="0" terminal="5,A" />
                    <input constant="MDLRequestMaterialSendReport" type="java.lang.String" />
                    <input constant="MDLMES" type="java.lang.String" />
                    <input constant="DeleteMDLRequestMaterialSend" type="java.lang.String" />
                    <input variable="reasonCodeType" type="java.lang.String" />
                    <input variable="reasonCode" type="java.lang.String" />
                    <output variable="eventInfo" />
                </invoke>
                <invoke name="MaterialShipRequestServiceImpl checkMDLShipRequest" type="invokebean" description="public java.lang.String checkMDLShipRequest(com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String siteName, java.lang.String shipRequestName)" bounds="372,585,141,105" partnerLink="MaterialShipRequestServiceImpl" partnerLinkType="MaterialShipRequestServiceImpl" operation="checkMDLShipRequest" operationDesc="public java.lang.String checkMDLShipRequest(com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String siteName, java.lang.String shipRequestName)" ignoreThrow="false" fork="false">
                    <source idx="0" terminal="5,A" />
                    <input variable="eventInfo" type="com.cim.idm.framework.data.EventInfo" />
                    <input constant="B17" type="java.lang.String" />
                    <input variable="shipRequestName" type="java.lang.String" />
                    <output variable="checkResult" />
                </invoke>
                <switch name="switch" bounds="426,720,33,33" type="switch">
                    <source idx="0" terminal="5,A" />
                    <switchstart name="switchstart" type="switchstart" bounds="387,799,110,49">
                        <source idx="0" terminal="5,A" />
                    </switchstart>
                    <case name="case" type="case" condition="getVariable('checkResult') = 'Y'" bounds="286,878,101,51">
                        <source idx="0" terminal="5,A" />
                        <invoke name="TransactionUtil beginTransaction" type="invokebean" description="public void beginTransaction()" bounds="266,959,141,105" partnerLink="TransactionUtil" partnerLinkType="TransactionUtil" operation="beginTransaction" operationDesc="public void beginTransaction()" ignoreThrow="false" fork="false">
                            <source idx="0" terminal="5,A" />
                        </invoke>
                        <invoke name="MaterialShipRequestServiceImpl remove" type="invokebean" description="public void remove(com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String siteName, java.lang.String shipRequestName)" bounds="266,1094,141,105" partnerLink="MaterialShipRequestServiceImpl" partnerLinkType="MaterialShipRequestServiceImpl" operation="remove" operationDesc="public void remove(com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String siteName, java.lang.String shipRequestName)" ignoreThrow="false" fork="false">
                            <source idx="0" terminal="5,A" />
                            <input variable="eventInfo" type="com.cim.idm.framework.data.EventInfo" />
                            <input constant="B17" type="java.lang.String" />
                            <input variable="shipRequestName" type="java.lang.String" />
                        </invoke>
                        <invoke name="TransactionUtil commitTransaction" type="invokebean" description="public void commitTransaction()" bounds="266,1229,141,105" partnerLink="TransactionUtil" partnerLinkType="TransactionUtil" operation="commitTransaction" operationDesc="public void commitTransaction()" ignoreThrow="false" fork="false">
                            <source idx="0" terminal="5,A" />
                        </invoke>
                        <terminate name="terminate" bounds="266,1364,141,65">
                            <source idx="0" terminal="5,A" />
                        </terminate>
                    </case>
                    <otherwise name="otherwise" type="otherwise" bounds="497,878,105,45">
                        <source idx="0" terminal="5,A" />
                        <invoke name="CommonValidation print" type="invokebean" description="public void print(java.lang.Object obj)" bounds="479,953,141,105" partnerLink="CommonValidation" partnerLinkType="CommonValidation" operation="print" operationDesc="public void print(java.lang.Object obj)" ignoreThrow="false" fork="false">
                            <source idx="0" terminal="5,A" />
                            <input variable="checkResult" type="java.lang.Object" />
                        </invoke>
                        <terminate name="terminate" bounds="479,1088,141,65">
                            <source idx="0" terminal="5,A" />
                        </terminate>
                    </otherwise>
                </switch>
            </case>
        </switch>
    </sequence>
</process>

