<?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="FabReturnToMWMS.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="MaterialShipRequestServiceImpl" partnerLinkType="bean:MaterialShipRequestServiceImpl" />
    </partnerLinks>
    <variables>
        <variable name="0001" messageType="java.lang.String"></variable>
        <variable name="311" messageType="java.lang.String"></variable>
        <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="contactNo" messageType="java.lang.String"></variable>
        <variable name="description" messageType="java.lang.String"></variable>
        <variable name="destination" 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('message', '//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="MES" messageType="java.lang.String"></variable>
        <variable name="MESCALL" messageType="java.lang.String"></variable>
        <variable name="message" messageType="org.jdom.Document"></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"></variable>
        <variable name="remark" messageType="java.lang.String"></variable>
        <variable name="replySubjectName" messageType="java.lang.String" expression="getXmlData('message', '//Message/Header/ORIGINALSOURCESUBJECTNAME')" />
        <variable name="returnType" messageType="java.lang.String"></variable>
        <variable name="rtTypeDescription" messageType="java.lang.String"></variable>
        <variable name="shipRequestDetailName" messageType="java.lang.String"></variable>
        <variable name="shipRequestName" messageType="java.lang.String"></variable>
        <variable name="shipTime" messageType="java.lang.String"></variable>
        <variable name="SMTSender" 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="773,36,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="message" 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','FabReturnToMWMSReply')" />
                <function value="setXmlData('toMESMessage','/Message/Return/RETURNCODE','ERROR')" />
            </expression>
            <invoke name="ESBService sendBySender" type="invokebean" description="public void sendBySender(org.jdom.Document doc, java.lang.String senderName)" bounds="65,331,141,105" partnerLink="ESBService" partnerLinkType="ESBService" operation="sendBySender" operationDesc="public void sendBySender(org.jdom.Document doc, java.lang.String senderName)" ignoreThrow="false" fork="false">
                <source idx="0" terminal="5,A" />
                <input variable="toMESMessage" type="org.jdom.Document" />
                <input constant="FABSender" 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="message" 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="FabReturnToMWMS" bounds="261,30,149,62">
            <input variable="message" type="org.jdom.Document" />
        </receive>
        <expression name="expression" type="expression" bounds="265,122,141,65">
            <source idx="0" terminal="5,A" />
            <function value="setVariable('flag',getXmlData('message', '//FLAG'))" />
            <function value="setVariable('shipRequestName',getXmlData('message', '//SHIPREQUESTNAME'))" />
            <function value="setVariable('shipTime',getXmlData('message', '//SHIPTIME'))" />
            <function value="setVariable('materialList',getElementList('message','//MATERIAL'))" />
        </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="265,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="FABReturnMaterialRequest" type="java.lang.String" />
            <input constant="FABMES" type="java.lang.String" />
            <input constant="FABReturnMaterialRequest" 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="319,352,33,33" type="switch">
            <source idx="0" terminal="5,A" />
            <switchstart name="switchstart" type="switchstart" bounds="280,431,110,49">
                <source idx="0" terminal="5,A" />
            </switchstart>
            <case name="case" type="case" condition="getVariable('flag') = '0'" bounds="114,510,60,49">
                <source idx="0" terminal="5,A" />
                <invoke name="TransactionUtil beginTransaction" type="invokebean" description="public void beginTransaction()" bounds="74,589,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,724,32,32" type="2" collection="materialList" element="materialElement">
                    <source idx="0" terminal="5,A" />
                    <whilestart name="whilestart" type="whilestart" bounds="89,803,110,49">
                        <source idx="0" terminal="5,A" />
                    </whilestart>
                    <expression name="expression" type="expression" bounds="74,882,141,65">
                        <source idx="0" terminal="5,A" />
                        <function value="setVariable('shipRequestDetailName',getXmlData('materialElement','//SHIPREQUESTDETAIL'))" />
                        <function value="setVariable('erpFactory',getXmlData('materialElement','//ERPFACTORY'))" />
                        <function value="setVariable('materialSpecName',getXmlData('materialElement','//MATERIALSPECNAME'))" />
                        <function value="setVariable('materialQuantity',getXmlData('materialElement','//QUANTITY'))" />
                        <function value="setVariable('returnType',getXmlData('materialElement','//RETURNTYPEDESC'))" />
                        <function value="setVariable('erpLocation',getXmlData('materialElement','//ERPLOCATION'))" />
                        <function value="setVariable('receiveLocation',getXmlData('materialElement','//ERPRECEIVELOCATION'))" />
                        <function value="setVariable('receiver',getXmlData('materialElement','//RETURNUSER'))" />
                        <function value="setVariable('destination',getXmlData('materialElement','//DESTINATION'))" />
                        <function value="setVariable('contactNo',getXmlData('materialElement','//CONTACTNO'))" />
                    </expression>
                    <invoke name="MaterialShipRequestServiceImpl saveFABShipRequest" type="invokebean" description="public void saveFABShipRequest(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, java.lang.String destination, java.lang.String contactNo)" bounds="74,977,141,105" partnerLink="MaterialShipRequestServiceImpl" partnerLinkType="MaterialShipRequestServiceImpl" operation="saveFABShipRequest" operationDesc="public void saveFABShipRequest(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, java.lang.String destination, java.lang.String contactNo)" ignoreThrow="false" fork="false">
                        <source idx="0" terminal="5,A" />
                        <input variable="shipRequestName" type="java.lang.String" />
                        <input variable="shipRequestDetailName" 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 constant="311" type="java.lang.String" />
                        <input constant="0001" 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="shipTime" 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" />
                        <input variable="destination" type="java.lang.String" />
                        <input variable="contactNo" type="java.lang.String" />
                    </invoke>
                    <whileend name="whileend" type="whileend" bounds="89,1102,110,49">
                        <source idx="0" terminal="5,A" />
                    </whileend>
                </while>
            </case>
            <case name="case" type="case" condition="getVariable('flag') = '1'" bounds="305,510,60,49">
                <source idx="0" terminal="5,A" />
                <invoke name="TransactionUtil beginTransaction" type="invokebean" description="public void beginTransaction()" bounds="265,589,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="319,724,32,32" type="2" collection="materialList" element="materialElement">
                    <source idx="0" terminal="5,A" />
                    <whilestart name="whilestart" type="whilestart" bounds="280,803,110,49">
                        <source idx="0" terminal="5,A" />
                    </whilestart>
                    <expression name="expression" type="expression" bounds="265,882,141,65">
                        <source idx="0" terminal="5,A" />
                        <function value="setVariable('erpFactory',getXmlData('materialElement','//ERPFACTORY'))" />
                        <function value="setVariable('receiveLocation',getXmlData('materialElement','//ERPRECEIVELOCATION'))" />
                        <function value="setVariable('materialQuantity',getXmlData('materialElement','//REQUESTQUANTITY'))" />
                        <function value="setVariable('materialSpecName',getXmlData('materialElement','//MATERIALSPEC'))" />
                        <function value="setVariable('shipRequestDetailName',getXmlData('materialElement','//SHIPREQUESTDETAIL'))" />
                        <function value="setVariable('receiver',getXmlData('materialElement','//RETURNUSER'))" />
                        <function value="setVariable('destination',getXmlData('materialElement','//DESTINATION'))" />
                        <function value="setVariable('contactNo',getXmlData('materialElement','//CONTACTNO'))" />
                    </expression>
                    <invoke name="MaterialShipRequestServiceImpl updateFABShipRequest" type="invokebean" description="public void updateFABShipRequest(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="265,977,141,105" partnerLink="MaterialShipRequestServiceImpl" partnerLinkType="MaterialShipRequestServiceImpl" operation="updateFABShipRequest" operationDesc="public void updateFABShipRequest(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="shipRequestName" />
                        <input variable="shipRequestDetailName" />
                        <input variable="erpFactory" />
                        <input variable="erpLocation" />
                        <input variable="eventInfo" />
                        <input constant="311" type="java.lang.String" />
                        <input constant="0001" type="java.lang.String" />
                        <input variable="workOrder" />
                        <input variable="materialSpecName" />
                        <input variable="materialQuantity" />
                        <input variable="charge" />
                        <input variable="receiveLocation" />
                        <input variable="receiver" />
                        <input variable="shipTime" />
                        <input variable="workOrderType" />
                        <input variable="returnType" />
                        <input variable="rtTypeDescription" />
                        <input variable="line" />
                        <input variable="remark" />
                        <input variable="supplierNO" />
                        <input constant="MESSHIP" type="java.lang.String" />
                        <input variable="destination" />
                        <input variable="contactNo" />
                    </invoke>
                    <whileend name="whileend" type="whileend" bounds="280,1102,110,49">
                        <source idx="0" terminal="5,A" />
                    </whileend>
                </while>
            </case>
            <case name="case" type="case" condition="getVariable('flag') = '2'" bounds="637,510,60,50">
                <source idx="0" terminal="5,A" />
                <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="597,590,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="651,725,33,33" type="switch">
                    <source idx="0" terminal="5,A" />
                    <switchstart name="switchstart" type="switchstart" bounds="612,804,110,49">
                        <source idx="0" terminal="5,A" />
                    </switchstart>
                    <case name="case" type="case" condition="getVariable('checkResult') = 'Y'" bounds="496,883,60,48">
                        <source idx="0" terminal="5,A" />
                        <invoke name="TransactionUtil beginTransaction" type="invokebean" description="public void beginTransaction()" bounds="456,961,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="456,1096,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>
                    </case>
                    <otherwise name="otherwise" type="otherwise" bounds="765,883,88,58">
                        <source idx="0" terminal="5,A" />
                        <invoke name="ESBService SMTsendReplyBySender" type="invokebean" description="public void sendReplyBySender(String replySubject, org.jdom.Document doc, org.jdom.Element element, String senderName)&#xD;&#xA;&#x9;&#x9;throws java.lang.Exception" bounds="661,971,296,102" partnerLink="ESBService" partnerLinkType="ESBService" operation="SMTsendReplyBySender" operationDesc="public void SMTsendReplyBySender(java.lang.String replySubject, org.jdom.Document doc, java.lang.String senderName, java.lang.String checkresult)" ignoreThrow="false" fork="false">
                            <source idx="0" terminal="5,A" />
                            <input variable="replySubjectName" type="java.lang.String" />
                            <input variable="message" type="org.jdom.Document" />
                            <input constant="FABSender" type="java.lang.String" />
                            <input variable="checkResult" type="java.lang.String" />
                        </invoke>
                        <terminate name="terminate" bounds="739,1103,141,65">
                            <source idx="0" terminal="5,A" />
                        </terminate>
                    </otherwise>
                </switch>
            </case>
            <switchend name="switchend" type="switchend" bounds="89,1221,110,49">
                <source idx="0" terminal="5,A" />
                <source idx="1" terminal="5,A" />
                <source idx="2" terminal="5,A" />
            </switchend>
        </switch>
        <invoke name="TransactionUtil commitTransaction" type="invokebean" description="public void commitTransaction()" bounds="74,1300,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="XmlUtil clone" type="invokebean" description="public org.jdom.Document clone(org.jdom.Document doc)" bounds="74,1435,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="message" type="org.jdom.Document" />
            <output variable="toMESMessage" />
        </invoke>
        <expression name="expression" type="expression" bounds="74,1570,141,65">
            <source idx="0" terminal="5,A" />
            <function value="setXmlData('toMESMessage','/Message/Header/MESSAGENAME','FabReturnToMWMSReply')" />
        </expression>
        <invoke name="ESBService sendBySender" type="invokebean" description="public void sendBySender(org.jdom.Document doc, java.lang.String senderName)" bounds="74,1665,141,105" partnerLink="ESBService" partnerLinkType="ESBService" operation="sendBySender" operationDesc="public void sendBySender(org.jdom.Document doc, java.lang.String senderName)" ignoreThrow="false" fork="false">
            <source idx="0" terminal="5,A" />
            <input variable="toMESMessage" type="org.jdom.Document" />
            <input constant="FABSender" type="java.lang.String" />
        </invoke>
    </sequence>
</process>

