<?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="14624.bpel">
    <partnerLinks>
        <partnerLink name="bpelj" partnerLinkType="bpel:bpelj" />
        <partnerLink name="TransactionUtil" partnerLinkType="bean:TransactionUtil" />
        <partnerLink name="ESBService" partnerLinkType="bean:ESBService" />
        <partnerLink name="ERPInterfaceServiceUtil" partnerLinkType="bean:ERPInterfaceServiceUtil" />
    </partnerLinks>
    <variables>
        <variable name="charge" messageType="java.lang.String"></variable>
        <variable name="E" messageType="java.lang.String"></variable>
        <variable name="erpFactory" messageType="java.lang.String"></variable>
        <variable name="erpLocation" messageType="java.lang.String"></variable>
        <variable name="erpMessageItemListSize" messageType="int"></variable>
        <variable name="ERPSender" messageType="java.lang.String"></variable>
        <variable name="error" messageType="java.lang.Exception"></variable>
        <variable name="INT_PI066" messageType="org.jdom.Document"></variable>
        <variable name="itemElement" messageType="org.jdom.Element"></variable>
        <variable name="itemList" messageType="java.util.List"></variable>
        <variable name="Items more than 15000" messageType="java.lang.String"></variable>
        <variable name="materialPacking" messageType="com.cim.idm.wmspackage.materialpacking.management.data.MaterialPackingStockInfo" expression="newInstance('com.cim.idm.wmspackage.materialpacking.management.data.MaterialPackingStockInfo')" />
        <variable name="materialPackingList" messageType="java.util.List"></variable>
        <variable name="materialSpecName" messageType="java.lang.String"></variable>
        <variable name="message" messageType="org.jdom.Document"></variable>
        <variable name="replaysubjectname" messageType="java.lang.String" expression="getXmlData('message', '//Message/Header/ORIGINALSOURCESUBJECTNAME')" />
        <variable name="replySubjectName" messageType="java.lang.String" expression="getXmlData('message', '//Message/Header/ORIGINALSOURCESUBJECTNAME')" />
        <variable name="S" messageType="java.lang.String"></variable>
        <variable name="ycharge" messageType="java.lang.String"></variable>
    </variables>
    <faultHandlers name="faultHandlers" bounds="773,25,272,591">
        <catchAll name="catchAll" type="catchAll" bounds="30,42,213,501">
            <invoke name="TransactionUtil rollbackTransaction" type="invokebean" description="public void rollbackTransaction()" bounds="31,5,141,105" partnerLink="TransactionUtil" partnerLinkType="TransactionUtil" operation="rollbackTransaction" operationDesc="public void rollbackTransaction()" ignoreThrow="false" fork="false" />
            <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="32,129,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="message" type="org.jdom.Document" />
                <input constant="" type="java.lang.String" />
                <input variable="error" type="java.lang.Exception" />
                <input constant="ERPSender" 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="32,262,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="28,386,141,65">
                <source idx="0" terminal="5,A" />
            </terminate>
        </catchAll>
    </faultHandlers>
    <sequence>
        <receive name="14624" bounds="279,30,149,62">
            <input variable="message" type="org.jdom.Document" />
        </receive>
        <expression name="expression" type="expression" bounds="283,122,141,65">
            <source idx="0" terminal="5,A" />
            <function value="setVariable('itemList', getElementList('message', '//item'))" />
        </expression>
        <expression name="expression" type="expression" bounds="522,123,141,65">
            <source idx="0" terminal="5,A" />
            <function value="setVariable('erpMessageItemListSize', getListSize('itemList'))" />
        </expression>
        <switch name="switch" bounds="337,217,33,33" type="switch">
            <source idx="0" terminal="5,A" />
            <switchstart name="switchstart" type="switchstart" bounds="298,296,110,49">
                <source idx="0" terminal="5,A" />
            </switchstart>
            <case name="case" type="case" condition="string(getVariable('erpMessageItemListSize')) &lt; 1001" bounds="116,375,56,61">
                <source idx="0" terminal="5,A" />
                <invoke name="ERPInterfaceServiceUtil createMaterialPackingList" type="invokebean" description="public java.util.List createMaterialPackingList()" bounds="74,466,141,105" partnerLink="ERPInterfaceServiceUtil" partnerLinkType="ERPInterfaceServiceUtil" operation="createMaterialPackingList" operationDesc="public java.util.List createMaterialPackingList()" ignoreThrow="false" fork="false">
                    <source idx="0" terminal="5,A" />
                    <output variable="materialPackingList" />
                </invoke>
                <while name="while" bounds="128,601,32,32" type="2" collection="itemList" element="itemElement">
                    <source idx="0" terminal="5,A" />
                    <whilestart name="whilestart" type="whilestart" bounds="89,680,110,49">
                        <source idx="0" terminal="5,A" />
                    </whilestart>
                    <expression name="expression" type="expression" bounds="74,759,141,65">
                        <source idx="0" terminal="5,A" />
                        <function value="setVariable('materialSpecName',getXmlData('itemElement','//&#x9;MATNR'))" />
                        <function value="setVariable('erpFactory',getXmlData('itemElement','//WERKS'))" />
                        <function value="setVariable('erpLocation',getXmlData('itemElement','//LGORT'))" />
                        <function value="setVariable('charge',getXmlData('itemElement','//CHARG'))" />
                        <function value="setVariable('ycharge',getXmlData('itemElement','//YCHARG'))" />
                    </expression>
                    <invoke name="ERPInterfaceServiceUtil queryStockState" type="invokebean" description="public java.util.List queryStockState(java.lang.String erpFactory, java.lang.String materialSpecName, java.lang.String erpLocation, java.lang.String charge, java.util.List mpList)" bounds="74,854,141,105" partnerLink="ERPInterfaceServiceUtil" partnerLinkType="ERPInterfaceServiceUtil" operation="queryStockState" operationDesc="public java.util.List queryStockState(java.lang.String erpFactory, java.lang.String materialSpecName, java.lang.String erpLocation, java.lang.String charge, java.util.List mpList)" ignoreThrow="false" fork="false">
                        <source idx="0" terminal="5,A" />
                        <input variable="erpFactory" type="java.lang.String" />
                        <input variable="materialSpecName" type="java.lang.String" />
                        <input variable="erpLocation" type="java.lang.String" />
                        <input variable="charge" type="java.lang.String" />
                        <input variable="materialPackingList" type="java.util.List" />
                        <output variable="materialPackingList" />
                        <fault faultName="catchAll" variable="error" />
                    </invoke>
                    <whileend name="whileend" type="whileend" bounds="191,979,110,49">
                        <source idx="0" terminal="5,A" />
                    </whileend>
                </while>
                <expression name="expression" type="expression" bounds="176,1058,141,65">
                    <source idx="0" terminal="5,A" />
                    <function value="removeElement('message','//Message/Body')" />
                    <function value="addElement('message','/Message','Body','')" />
                </expression>
                <switch name="switch" bounds="230,1153,33,33" type="switch">
                    <source idx="0" terminal="5,A" />
                    <switchstart name="switchstart" type="switchstart" bounds="191,1232,110,49">
                        <source idx="0" terminal="5,A" />
                    </switchstart>
                    <case name="case" type="case" condition="isNull('materialPackingList')!='true()'&#xA; and getListSize('materialPackingList')&gt;0" bounds="115,1311,59,60">
                        <source idx="0" terminal="5,A" />
                        <while name="while" bounds="128,1401,32,32" type="2" collection="materialPackingList" element="materialPacking">
                            <source idx="0" terminal="5,A" />
                            <whilestart name="whilestart" type="whilestart" bounds="89,1480,110,49">
                                <source idx="0" terminal="5,A" />
                            </whilestart>
                            <expression name="expression" type="expression" bounds="74,1559,141,65">
                                <source idx="0" terminal="5,A" />
                                <function value="addElement('message','/Message/Body','item','')" />
                                <function value="addChildNode('message','/Message/Body/*[last()]',createNode('WERKS',getField('materialPacking','erpFactory')))" />
                                <function value="addChildNode('message','/Message/Body/*[last()]',createNode('MATNR',getField('materialPacking','materialSpecName')))" />
                                <function value="addChildNode('message','/Message/Body/*[last()]',createNode('LGORT',getField('materialPacking','erpLocation')))" />
                                <function value="addChildNode('message','/Message/Body/*[last()]',createNode('CHARG',getField('materialPacking','charge')))" />
                                <function value="addChildNode('message','/Message/Body/*[last()]',createNode('LABST',getField('materialPacking','okQuantity')))" />
                                <function value="addChildNode('message','/Message/Body/*[last()]',createNode('INSME',getField('materialPacking','preOqaQuantity')))" />
                                <function value="addChildNode('message','/Message/Body/*[last()]',createNode('SPEME',getField('materialPacking','ngQuantity')))" />
                                <function value="addChildNode('message','/Message/Body/*[last()]',createNode('SOBKZ',getField('materialPacking','specialFlag')))" />
                                <function value="addChildNode('message','/Message/Body/*[last()]',createNode('LIFNR',getField('materialPacking','supplierName')))" />
                                <function value="addChildNode('message','/Message/Body/*[last()]',createNode('POSID',getField('materialPacking','posID')))" />
                            </expression>
                            <whileend name="whileend" type="whileend" bounds="89,1644,110,49">
                                <source idx="0" terminal="5,A" />
                            </whileend>
                        </while>
                        <invoke name="ESBService sendQueryReplyBySender" type="invokebean" description="public void sendQueryReplyBySender(java.lang.String replySubject, org.jdom.Document doc, java.lang.String senderName, java.lang.String resultCode, java.lang.String resultMessage)" bounds="74,1723,141,105" partnerLink="ESBService" partnerLinkType="ESBService" operation="sendQueryReplyBySender" operationDesc="public void sendQueryReplyBySender(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="message" type="org.jdom.Document" />
                            <input constant="ERPSender" type="java.lang.String" />
                            <input constant="0" type="java.lang.String" />
                            <input constant="Query Success��" type="java.lang.String" />
                        </invoke>
                    </case>
                    <otherwise name="otherwise" type="otherwise" bounds="305,1311,89,50">
                        <source idx="0" terminal="5,A" />
                        <invoke name="ESBService sendQueryReplyBySender" type="invokebean" description="public void sendQueryReplyBySender(java.lang.String replySubject, org.jdom.Document doc, java.lang.String senderName, java.lang.String resultCode, java.lang.String resultMessage)" bounds="279,1391,141,105" partnerLink="ESBService" partnerLinkType="ESBService" operation="sendQueryReplyBySender" operationDesc="public void sendQueryReplyBySender(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="message" type="org.jdom.Document" />
                            <input constant="ERPSender" type="java.lang.String" />
                            <input constant="0" type="java.lang.String" />
                            <input constant="No Box��" type="java.lang.String" />
                        </invoke>
                    </otherwise>
                </switch>
            </case>
            <otherwise name="otherwise" type="otherwise" bounds="510,375,106,57">
                <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="493,462,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="replaysubjectname" />
                    <input variable="message" />
                    <input constant="ERPSender" type="java.lang.String" />
                    <input constant="E" type="java.lang.String" />
                    <input constant="Item's quantity can't be more than 1000!" type="java.lang.String" />
                    <input variable="erpMessageItemListSize" />
                </invoke>
            </otherwise>
        </switch>
    </sequence>
</process>

