<?xml version="1.0" encoding="GBK"?>
<process xmlns:bean="http://bean.boe.com/" xmlns:bpel="http://bpel.boe.com/" targetNamespace="http://bpel.boe.com/bpelj/" name="ReturnMaterialSendReport.bpel">
    <partnerLinks>
        <partnerLink name="bpelj" partnerLinkType="bpel:bpelj" />
        <partnerLink name="TransactionUtil" partnerLinkType="bean:TransactionUtil" />
        <partnerLink name="XmlUtil" partnerLinkType="bean:XmlUtil" />
        <partnerLink name="ESBService" partnerLinkType="bean:ESBService" />
        <partnerLink name="EventInfoUtil" partnerLinkType="bean:EventInfoUtil" />
        <partnerLink name="ERPInterfaceServiceUtil" partnerLinkType="bean:ERPInterfaceServiceUtil" />
    </partnerLinks>
    <variables>
        <variable name="charge" 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="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="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="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>
    <faultHandlers name="faultHandlers" bounds="492,39,339,800">
        <catchAll name="catchAll" type="catchAll" bounds="24,49,285,715">
            <invoke name="TransactionUtil rollbackTransaction" type="invokebean" description="public void rollbackTransaction()" bounds="67,0,141,105" partnerLink="TransactionUtil" partnerLinkType="TransactionUtil" operation="rollbackTransaction" operationDesc="public void rollbackTransaction()" ignoreThrow="false" fork="false" />
            <invoke name="XmlUtil clone" type="invokebean" description="public org.jdom.Document clone(org.jdom.Document doc)" bounds="66,118,141,105" partnerLink="XmlUtil" partnerLinkType="XmlUtil" operation="clone" operationDesc="public org.jdom.Document clone(org.jdom.Document doc)" ignoreThrow="false" fork="false">
                <source idx="0" terminal="5,A" />
                <input variable="ReturnMaterialSendReport" type="org.jdom.Document" />
                <output variable="toMESMessage" />
            </invoke>
            <expression name="expression" type="expression" bounds="65,244,141,65">
                <source idx="0" terminal="5,A" />
                <function value="setXmlData('toMESMessage','/Message/Header/MESSAGENAME','ReturnMaterialReceiveReport')" />
                <function value="removeElement('toMESMessage','/Message/Body')" />
                <function value="addChildNode('toMESMessage','/Message',createNode('Body',''))" />
                <function value="addElement('toMESMessage','/Message/Body','SHIPREQUESTNAME',getVariable('rtShipRequestName'))" />
            </expression>
            <invoke name="ESBService sendErrorBySender" type="invokebean" description="public void sendErrorBySender(java.lang.String replySubject, org.jdom.Document doc, java.lang.String lanuage, java.lang.Exception e, java.lang.String senderName)" bounds="65,331,141,105" partnerLink="ESBService" partnerLinkType="ESBService" operation="sendErrorBySender" operationDesc="public void sendErrorBySender(java.lang.String replySubject, org.jdom.Document doc, java.lang.String lanuage, java.lang.Exception e, java.lang.String senderName)" ignoreThrow="false" fork="false">
                <source idx="0" terminal="5,A" />
                <input variable="replySubjectName" type="java.lang.String" />
                <input variable="toMESMessage" type="org.jdom.Document" />
                <input constant="" type="java.lang.String" />
                <input variable="error" type="java.lang.Exception" />
                <input constant="MESSender" type="java.lang.String" />
            </invoke>
            <invoke name="ESBService makeErrorMessageLog" type="invokebean" description="public java.lang.String makeErrorMessageLog(org.jdom.Document doc, java.lang.Exception e, java.lang.String language)" bounds="64,456,141,105" partnerLink="ESBService" partnerLinkType="ESBService" operation="makeErrorMessageLog" operationDesc="public java.lang.String makeErrorMessageLog(org.jdom.Document doc, java.lang.Exception e, java.lang.String language)" ignoreThrow="false" fork="false">
                <source idx="0" terminal="5,A" />
                <input variable="ReturnMaterialSendReport" type="org.jdom.Document" />
                <input variable="error" type="java.lang.Exception" />
                <input constant="" type="java.lang.String" />
            </invoke>
            <terminate name="terminate" bounds="65,577,141,65">
                <source idx="0" terminal="5,A" />
            </terminate>
        </catchAll>
    </faultHandlers>
    <sequence>
        <receive name="ReturnMaterialSendReport" bounds="70,30,149,62">
            <input variable="ReturnMaterialSendReport" type="org.jdom.Document" />
        </receive>
        <expression name="expression" type="expression" bounds="74,122,141,65">
            <source idx="0" terminal="5,A" />
            <function value="setVariable('workOrderList',getElementList('ReturnMaterialSendReport','//WORKORDERLIST'))" />
        </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,217,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>
        <switch name="switch" bounds="128,352,33,33" type="switch">
            <source idx="0" terminal="5,A" />
            <switchstart name="switchstart" type="switchstart" bounds="89,431,110,49">
                <source idx="0" terminal="5,A" />
            </switchstart>
            <case name="case" type="case" condition="getVariable('eventUser') = 'B5MES'" bounds="114,510,60,19">
                <source idx="0" terminal="5,A" />
                <invoke name="ERPInterfaceServiceUtil deleteUnAssignedRTShipRequestdetail" type="invokebean" description="public void deleteUnAssignedRTShipRequestdetail(java.lang.String rtShipRequestName, java.lang.String sitename, com.cim.idm.framework.data.EventInfo eventInfo)" bounds="74,559,141,105" partnerLink="ERPInterfaceServiceUtil" partnerLinkType="ERPInterfaceServiceUtil" operation="deleteUnAssignedRTShipRequestdetail" operationDesc="public void deleteUnAssignedRTShipRequestdetail(java.lang.String rtShipRequestName, java.lang.String sitename, com.cim.idm.framework.data.EventInfo eventInfo)" ignoreThrow="false" fork="false">
                    <source idx="0" terminal="5,A" />
                    <input variable="rtShipRequestName" type="java.lang.String" />
                    <input variable="eventInfo" type="com.cim.idm.framework.data.EventInfo" />
                </invoke>
            </case>
            <otherwise name="otherwise" type="otherwise" bounds="279,510,88,19">
                <source idx="0" terminal="5,A" />
            </otherwise>
            <switchend name="switchend" type="switchend" bounds="89,684,110,49">
                <source idx="0" terminal="5,A" />
                <source idx="1" terminal="5,A" />
            </switchend>
        </switch>
        <invoke name="TransactionUtil beginTransaction" type="invokebean" description="public void beginTransaction()" bounds="74,763,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,898,32,32" type="2" collection="workOrderList" element="woElement">
            <source idx="0" terminal="5,A" />
            <whilestart name="whilestart" type="whilestart" bounds="89,977,110,49">
                <source idx="0" terminal="5,A" />
            </whilestart>
            <expression name="expression" type="expression" bounds="74,1056,141,65">
                <source idx="0" terminal="5,A" />
                <function value="setVariable('workOrder',getXmlData('woElement','//WORKORDER'))" />
                <function value="setVariable('workOrderType',getXmlData('woElement','//WORKORDERTYPE'))" />
                <function value="setVariable('materialList',getElementList('woElement','//MATERIALLIST'))" />
            </expression>
            <while name="while" bounds="128,1151,32,32" type="2" collection="materialList" element="materialElement">
                <source idx="0" terminal="5,A" />
                <whilestart name="whilestart" type="whilestart" bounds="89,1230,110,49">
                    <source idx="0" terminal="5,A" />
                </whilestart>
                <expression name="expression" type="expression" bounds="74,1309,141,65">
                    <source idx="0" terminal="5,A" />
                    <function value="setVariable('erpFactory',getXmlData('materialElement','//ERPFACTORY'))" />
                    <function value="setVariable('materialSpecName',getXmlData('materialElement','//MATERIALSPECNAME'))" />
                    <function value="setVariable('description',getXmlData('materialElement','//DESCRIPTION'))" />
                    <function value="setVariable('materialQuantity',getXmlData('materialElement','//QUANTITY'))" />
                    <function value="setVariable('returnType',getXmlData('materialElement','//RETURNTYPE'))" />
                    <function value="setVariable('erpLocation',getXmlData('materialElement','//ERPLOCATION'))" />
                    <function value="setVariable('receiveLocation',getXmlData('materialElement','//ERPRECEIVELOCATION'))" />
                    <function value="setVariable('reasonCodeType',getXmlData('materialElement','//REASONCODETYPE'))" />
                    <function value="setVariable('reasonCode',getXmlData('materialElement','//REASONCODE'))" />
                    <function value="setVariable('supplierNO',getXmlData('materialElement','//SUPPLIERNO'))" />
                    <function value="setVariable('charge',getXmlData('materialElement','//CHARGE'))" />
                    <function value="setVariable('remark',getXmlData('materialElement','//TEXT'))" />
                    <function value="setVariable('line',getXmlData('materialElement','//LINE'))" />
                    <function value="setVariable('rtShipRequestDetailName',getXmlData('materialElement','//SHIPREQUESTDETAIL'))" />
                    <function value="setVariable('rtTypeDescription',getXmlData('materialElement','//RETURNTYPEDESC'))" />
                </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,1404,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="ERPInterfaceServiceUtil saveRTShipRequest" type="invokebean" description="public void saveRTShipRequest(java.lang.String rtShipRequestName, java.lang.String rtShipRequestDetailName, 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)" bounds="74,1539,141,105" partnerLink="ERPInterfaceServiceUtil" partnerLinkType="ERPInterfaceServiceUtil" operation="saveRTShipRequest" operationDesc="public void saveRTShipRequest(java.lang.String rtShipRequestName, java.lang.String rtShipRequestDetailName, 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)" 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" />
                    <fault faultName="catchAll" variable="error" />
                </invoke>
                <whileend name="whileend" type="whileend" bounds="89,1664,110,49">
                    <source idx="0" terminal="5,A" />
                </whileend>
            </while>
            <whileend name="whileend" type="whileend" bounds="89,1733,110,49">
                <source idx="0" terminal="5,A" />
            </whileend>
        </while>
        <invoke name="TransactionUtil commitTransaction" type="invokebean" description="public void commitTransaction()" bounds="74,1812,141,105" partnerLink="TransactionUtil" partnerLinkType="TransactionUtil" operation="commitTransaction" operationDesc="public void commitTransaction()" ignoreThrow="false" fork="false">
            <source idx="0" terminal="5,A" />
        </invoke>
        <invoke name="ESBService sendReplyBySender" type="invokebean" description="public void sendReplyBySender(java.lang.String replySubject, org.jdom.Document doc, java.lang.String senderName)" bounds="74,1947,141,105" partnerLink="ESBService" partnerLinkType="ESBService" operation="sendReplyBySender" operationDesc="public void sendReplyBySender(java.lang.String replySubject, org.jdom.Document doc, java.lang.String senderName)" ignoreThrow="false" fork="false">
            <source idx="0" terminal="5,A" />
            <input variable="replySubjectName" type="java.lang.String" />
            <input variable="ReturnMaterialSendReport" type="org.jdom.Document" />
            <input constant="MESSender" type="java.lang.String" />
        </invoke>
    </sequence>
</process>

