<?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="RTStockIn.bpel">
    <partnerLinks>
        <partnerLink name="bpelj" partnerLinkType="bpel:bpelj" />
        <partnerLink name="EventInfoUtil" partnerLinkType="bean:EventInfoUtil" />
        <partnerLink name="TransactionUtil" partnerLinkType="bean:TransactionUtil" />
        <partnerLink name="MaterialPackingStockInImpl" partnerLinkType="bean:MaterialPackingStockInImpl" />
        <partnerLink name="ESBService" partnerLinkType="bean:ESBService" />
        <partnerLink name="XmlUtil" partnerLinkType="bean:XmlUtil" />
        <partnerLink name="MaterialShipRequestServiceImpl" partnerLinkType="bean:MaterialShipRequestServiceImpl" />
    </partnerLinks>
    <variables>
        <variable name="E" messageType="java.lang.String"></variable>
        <variable name="ERP No Reply Message!" messageType="java.lang.String"></variable>
        <variable name="ERPTime" messageType="java.lang.String" expression="getXmlData('RTStockIn', '//Message/Body/LASTEVENTTIME')" />
        <variable name="eventComment" messageType="java.lang.String" expression="getXmlData('RTStockIn', '//Message/Body/EVENTCOMMENT')" />
        <variable name="eventInfo" messageType="com.cim.idm.framework.data.EventInfo"></variable>
        <variable name="eventUser" messageType="java.lang.String" expression="getXmlData('RTStockIn', '//Message/Body/LASTEVENTUSER')" />
        <variable name="MaterialShipRequest" messageType="com.cim.idm.wmspackage.materialshiprequest.management.data.MaterialShipRequest"></variable>
        <variable name="messageID" messageType="java.lang.String"></variable>
        <variable name="MESSender" messageType="java.lang.String"></variable>
        <variable name="OICSender" messageType="java.lang.String"></variable>
        <variable name="PDASender" messageType="java.lang.String"></variable>
        <variable name="replySubjectName" messageType="java.lang.String" expression="getXmlData('RTStockIn', '//Message/Header/ORIGINALSOURCESUBJECTNAME')" />
        <variable name="ReturnMaterialSendReport" messageType="org.jdom.Document"></variable>
        <variable name="RTStockIn" messageType="org.jdom.Document"></variable>
        <variable name="rtStockinList" messageType="java.util.List"></variable>
        <variable name="shipRequestName" messageType="java.lang.String" expression="getXmlData('RTStockIn', '//Message/Body/SHIPREQUESTNAME')" />
        <variable name="siteName" messageType="java.lang.String" expression="getXmlData('RTStockIn', '//Message/Body/SITENAME')" />
        <variable name="toMESMessage" messageType="org.jdom.Document"></variable>
        <variable name="undoInfoList" messageType="java.util.List"></variable>
    </variables>
    <sequence>
        <receive name="RTStockIn" bounds="428,30,149,62">
            <input variable="RTStockIn" type="org.jdom.Document" />
        </receive>
        <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="432,122,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="RTStockIn" type="java.lang.String" />
            <input variable="eventUser" type="java.lang.String" />
            <input variable="eventComment" type="java.lang.String" />
            <input constant="" type="java.lang.String" />
            <input constant="" type="java.lang.String" />
            <output variable="eventInfo" />
        </invoke>
        <invoke name="TransactionUtil beginTransaction" type="invokebean" description="public void beginTransaction()" bounds="432,257,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="MaterialPackingStockInImpl GetMessageID" type="invokebean" description="public java.lang.String GetMessageID(java.lang.String sitename)" bounds="432,392,141,105" partnerLink="MaterialPackingStockInImpl" partnerLinkType="MaterialPackingStockInImpl" operation="GetMessageID" operationDesc="public java.lang.String GetMessageID(java.lang.String sitename)" ignoreThrow="false" fork="false">
            <source idx="0" terminal="5,A" />
            <input variable="siteName" type="java.lang.String" />
            <output variable="messageID" />
        </invoke>
        <invoke name="TransactionUtil commitTransaction" type="invokebean" description="public void commitTransaction()" bounds="432,527,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="TransactionUtil beginTransaction" type="invokebean" description="public void beginTransaction()" bounds="432,662,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="MaterialPackingStockInImpl getRTStockinList" type="invokebean" description="public java.util.List getRTStockinList(java.lang.String siteName, java.lang.String shipRequestName)" bounds="432,797,141,105" partnerLink="MaterialPackingStockInImpl" partnerLinkType="MaterialPackingStockInImpl" operation="getRTStockinList" operationDesc="public java.util.List getRTStockinList(java.lang.String siteName, java.lang.String shipRequestName)" ignoreThrow="false" fork="false">
            <source idx="0" terminal="5,A" />
            <input variable="siteName" type="java.lang.String" />
            <input variable="shipRequestName" type="java.lang.String" />
            <output variable="rtStockinList" />
        </invoke>
        <invoke name="MaterialPackingStockInImpl sendRTStockinInfo" type="invokebean" description="public java.util.List sendRTStockinInfo(com.cim.idm.framework.data.EventInfo eventInfo, java.util.List rtStockinList, java.lang.String siteName, java.lang.String shipRequestName, java.lang.String messageID, java.lang.String ERPTime)" bounds="432,932,141,105" partnerLink="MaterialPackingStockInImpl" partnerLinkType="MaterialPackingStockInImpl" operation="sendRTStockinInfo" operationDesc="public java.util.List sendRTStockinInfo(com.cim.idm.framework.data.EventInfo eventInfo, java.util.List rtStockinList, java.lang.String siteName, java.lang.String shipRequestName, java.lang.String messageID, java.lang.String ERPTime)" ignoreThrow="false" fork="false">
            <source idx="0" terminal="5,A" />
            <input variable="eventInfo" type="com.cim.idm.framework.data.EventInfo" />
            <input variable="rtStockinList" type="java.util.List" />
            <input variable="siteName" type="java.lang.String" />
            <input variable="shipRequestName" type="java.lang.String" />
            <input variable="messageID" type="java.lang.String" />
            <input variable="ERPTime" type="java.lang.String" />
            <output variable="undoInfoList" />
        </invoke>
        <invoke name="TransactionUtil commitTransaction" type="invokebean" description="public void commitTransaction()" bounds="432,1067,141,105" partnerLink="TransactionUtil" partnerLinkType="TransactionUtil" operation="commitTransaction" operationDesc="public void commitTransaction()" ignoreThrow="false" fork="false">
            <source idx="0" terminal="5,A" />
        </invoke>
        <switch name="switch" bounds="486,1202,33,33" type="switch">
            <source idx="0" terminal="5,A" />
            <switchstart name="switchstart" type="switchstart" bounds="447,1281,110,49">
                <source idx="0" terminal="5,A" />
            </switchstart>
            <case name="case" type="case" condition="getListSize('undoInfoList') &gt; 0" bounds="216,1360,60,46">
                <source idx="0" terminal="5,A" />
                <invoke name="TransactionUtil beginTransaction" type="invokebean" description="public void beginTransaction()" bounds="176,1436,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="MaterialPackingStockInImpl saveRTStockinInfo" type="invokebean" description="public void saveRTStockinInfo(java.util.List stockinList, java.util.List undoList, java.lang.String siteName, com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String shipRequestName)" bounds="176,1571,141,105" partnerLink="MaterialPackingStockInImpl" partnerLinkType="MaterialPackingStockInImpl" operation="saveRTStockinInfo" operationDesc="public void saveRTStockinInfo(java.util.List stockinList, java.util.List undoList, java.lang.String siteName, com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String shipRequestName)" ignoreThrow="false" fork="false">
                    <source idx="0" terminal="5,A" />
                    <input variable="rtStockinList" type="java.util.List" />
                    <input variable="undoInfoList" type="java.util.List" />
                    <input variable="siteName" type="java.lang.String" />
                    <input variable="eventInfo" type="com.cim.idm.framework.data.EventInfo" />
                    <input variable="shipRequestName" type="java.lang.String" />
                </invoke>
                <invoke name="TransactionUtil commitTransaction" type="invokebean" description="public void commitTransaction()" bounds="176,1706,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="TransactionUtil beginTransaction" type="invokebean" description="public void beginTransaction()" bounds="176,1841,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="MaterialPackingStockInImpl updateRTStockinShipInfoForPC" type="invokebean" description="public void updateRTStockinShipInfoForPC(java.lang.String siteName, java.lang.String shipRequestName)" bounds="176,1976,141,105" partnerLink="MaterialPackingStockInImpl" partnerLinkType="MaterialPackingStockInImpl" operation="updateRTStockinShipInfoForPC" operationDesc="public void updateRTStockinShipInfoForPC(java.lang.String siteName, java.lang.String shipRequestName)" ignoreThrow="false" fork="false">
                    <source idx="0" terminal="5,A" />
                    <input variable="siteName" type="java.lang.String" />
                    <input variable="shipRequestName" type="java.lang.String" />
                </invoke>
                <invoke name="TransactionUtil commitTransaction" type="invokebean" description="public void commitTransaction()" bounds="176,2111,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="176,2246,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="RTStockIn" type="org.jdom.Document" />
                    <input constant="OICSender" type="java.lang.String" />
                </invoke>
                <invoke name="XmlUtil clone" type="invokebean" description="public org.jdom.Document clone(org.jdom.Document doc)" bounds="176,2381,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="RTStockIn" type="org.jdom.Document" />
                    <output variable="toMESMessage" />
                </invoke>
                <invoke name="MaterialShipRequestServiceImpl getShipRequest" type="invokebean" description="public com.cim.idm.wmspackage.materialshiprequest.management.data.MaterialShipRequest getShipRequest(java.lang.String siteName, java.lang.String invoiceNo)" bounds="176,2516,141,105" partnerLink="MaterialShipRequestServiceImpl" partnerLinkType="MaterialShipRequestServiceImpl" operation="getShipRequest" operationDesc="public com.cim.idm.wmspackage.materialshiprequest.management.data.MaterialShipRequest getShipRequest(java.lang.String siteName, java.lang.String invoiceNo)" ignoreThrow="false" fork="false">
                    <source idx="0" terminal="5,A" />
                    <input variable="siteName" type="java.lang.String" />
                    <input variable="shipRequestName" type="java.lang.String" />
                    <output variable="MaterialShipRequest" />
                </invoke>
                <switch name="switch" bounds="230,2651,33,33" type="switch">
                    <source idx="0" terminal="5,A" />
                    <switchstart name="switchstart" type="switchstart" bounds="191,2730,110,49">
                        <source idx="0" terminal="5,A" />
                    </switchstart>
                    <case name="case" type="case" condition="getField(getVariable('MaterialShipRequest'), 'receiver')='FAB'" bounds="114,2809,60,53">
                        <source idx="0" terminal="5,A" />
                        <expression name="expression" type="expression" bounds="74,2892,141,65">
                            <source idx="0" terminal="5,A" />
                            <function value="setXmlData('toMESMessage','/Message/Header/MESSAGENAME','ReceiveReturnMaterialReport')" />
                            <function value="removeElement('toMESMessage','/Message/Body')" />
                            <function value="addChildNode('toMESMessage','/Message',createNode('Body',''))" />
                            <function value="addElement('toMESMessage','/Message/Body','SHIPREQUESTNAME',getVariable('shipRequestName'))" />
                        </expression>
                        <invoke name="ESBService sendByMesSender" type="invokebean" description="public static void sendByMesSender(org.jdom.Document doc, java.lang.String senderName)" bounds="74,2987,141,105" partnerLink="ESBService" partnerLinkType="ESBService" operation="sendByMesSender" operationDesc="public static void sendByMesSender(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>
                        <terminate name="terminate" bounds="74,3122,141,65">
                            <source idx="0" terminal="5,A" />
                        </terminate>
                    </case>
                    <otherwise name="otherwise" type="otherwise" bounds="407,2809,88,48">
                        <source idx="0" terminal="5,A" />
                        <expression name="expression" type="expression" bounds="381,2887,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('shipRequestName'))" />
                        </expression>
                        <switch name="switch" bounds="435,2982,33,33" type="switch">
                            <source idx="0" terminal="5,A" />
                            <switchstart name="switchstart" type="switchstart" bounds="396,3061,110,49">
                                <source idx="0" terminal="5,A" />
                            </switchstart>
                            <case name="case" type="case" condition="getVariable('siteName')  = 'TM1'" bounds="319,3140,60,19">
                                <source idx="0" terminal="5,A" />
                                <invoke name="ESBService sendByMesSender" type="invokebean" description="public static void sendByMesSender(org.jdom.Document doc, java.lang.String senderName)" bounds="279,3189,141,105" partnerLink="ESBService" partnerLinkType="ESBService" operation="sendByMesSender" operationDesc="public static void sendByMesSender(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="MESSenderForTM1" type="java.lang.String" />
                                </invoke>
                            </case>
                            <otherwise name="otherwise" type="otherwise" bounds="510,3140,88,19">
                                <source idx="0" terminal="5,A" />
                                <invoke name="ESBService sendByMesSender" type="invokebean" description="public static void sendByMesSender(org.jdom.Document doc, java.lang.String senderName)" bounds="484,3189,141,105" partnerLink="ESBService" partnerLinkType="ESBService" operation="sendByMesSender" operationDesc="public static void sendByMesSender(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="MESSender" type="java.lang.String" />
                                </invoke>
                            </otherwise>
                            <switchend name="switchend" type="switchend" bounds="399,3309,110,49">
                                <source idx="0" terminal="5,A" />
                                <source idx="1" terminal="5,A" />
                            </switchend>
                        </switch>
                        <terminate name="terminate" bounds="364,3381,141,65">
                            <source idx="0" terminal="5,A" />
                        </terminate>
                    </otherwise>
                </switch>
            </case>
            <otherwise name="otherwise" type="otherwise" bounds="715,1360,88,51">
                <source idx="0" terminal="5,A" />
                <invoke name="ESBService sendReplyBySender" type="invokebean" description="public void sendReplyBySender(java.lang.String replySubject, org.jdom.Document doc, java.lang.String senderName, java.lang.String resultCode, java.lang.String resultMessage)" bounds="689,1441,141,105" partnerLink="ESBService" partnerLinkType="ESBService" operation="sendReplyBySender" operationDesc="public void sendReplyBySender(java.lang.String replySubject, org.jdom.Document doc, java.lang.String senderName, java.lang.String resultCode, java.lang.String resultMessage)" ignoreThrow="false" fork="false">
                    <source idx="0" terminal="5,A" />
                    <input variable="replySubjectName" type="java.lang.String" />
                    <input variable="RTStockIn" type="org.jdom.Document" />
                    <input constant="OICSender" type="java.lang.String" />
                    <input constant="E" type="java.lang.String" />
                    <input constant="ERP No Reply Message!" type="java.lang.String" />
                </invoke>
            </otherwise>
            <switchend name="switchend" type="switchend" bounds="395,3467,110,49">
                <source idx="0" terminal="5,A">
                    <BendPoint FirstRelative="148,191" SecondRelative="-159,-6" weight="0.5" />
                    <BendPoint FirstRelative="173,205" SecondRelative="-134,8" weight="0.5" />
                </source>
                <source idx="1" terminal="5,A">
                    <BendPoint FirstRelative="-11,986" SecondRelative="297,-852" weight="0.5" />
                    <BendPoint FirstRelative="-20,1728" SecondRelative="288,-110" weight="0.5" />
                </source>
            </switchend>
        </switch>
        <terminate name="terminate" bounds="386,3572,141,65">
            <source idx="0" terminal="5,A" />
        </terminate>
    </sequence>
</process>

