<?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="PDADessignPreShipRequestToBoxforMES.bpel">
    <partnerLinks>
        <partnerLink name="bpelj" partnerLinkType="bpel:bpelj" />
        <partnerLink name="EventInfoUtil" partnerLinkType="bean:EventInfoUtil" />
        <partnerLink name="TransactionUtil" partnerLinkType="bean:TransactionUtil" />
        <partnerLink name="MaterialPackingServiceImpl" partnerLinkType="bean:MaterialPackingServiceImpl" />
        <partnerLink name="ESBService" partnerLinkType="bean:ESBService" />
        <partnerLink name="MaterialShipRequestServiceImpl" partnerLinkType="bean:MaterialShipRequestServiceImpl" />
        <partnerLink name="ERPInterfaceServiceImpl" partnerLinkType="bean:ERPInterfaceServiceImpl" />
        <partnerLink name="XmlUtil" partnerLinkType="bean:XmlUtil" />
    </partnerLinks>
    <variables>
        <variable name="00" messageType="java.lang.String"></variable>
        <variable name="assignedBoxCount" messageType="int"></variable>
        <variable name="boxID" messageType="java.lang.String" expression="getXmlData('PDADessignPreShipRequestToBox', '//Message/Body/MATERIALPACKINGNAME')" />
        <variable name="deliveryType" messageType="java.lang.String"></variable>
        <variable name="eventComment" messageType="java.lang.String" expression="getXmlData('PDADessignPreShipRequestToBox', '//Message/Header/EVENTCOMMENT')" />
        <variable name="eventInfo" messageType="com.cim.idm.framework.data.EventInfo"></variable>
        <variable name="eventUser" messageType="java.lang.String" expression="getXmlData('PDADessignPreShipRequestToBox', '//Message/Header/EVENTUSER')" />
        <variable name="message" messageType="org.jdom.Document"></variable>
        <variable name="MESSender" messageType="java.lang.String"></variable>
        <variable name="PDADessignPreShipRequestToBox" messageType="org.jdom.Document"></variable>
        <variable name="PDASender" messageType="java.lang.String"></variable>
        <variable name="PreAssignShipRequest" messageType="java.lang.String"></variable>
        <variable name="receiveActNO" messageType="java.lang.String" expression="getXmlData('PDADessignPreShipRequestToBox', '//Message/Body/RECEIVEACTNO')" />
        <variable name="replySubjectName" messageType="java.lang.String" expression="getXmlData('PDADessignPreShipRequestToBox', '//Message/Header/ORIGINALSOURCESUBJECTNAME')" />
        <variable name="shipRequest" messageType="com.cim.idm.wmspackage.materialshiprequest.management.data.MaterialShipRequest"></variable>
        <variable name="shipRequestName" messageType="java.lang.String"></variable>
        <variable name="siteName" messageType="java.lang.String" expression="getXmlData('PDADessignPreShipRequestToBox', '//Message/Body/SITENAME')" />
        <variable name="toMESMessage" messageType="org.jdom.Document"></variable>
    </variables>
    <sequence>
        <receive name="PDADessignPreShipRequestToBoxforMES" bounds="1170,30,149,62">
            <input variable="PDADessignPreShipRequestToBox" 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="1174,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="PDADessignPreShipRequestToBox" 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="1173,257,143,90" partnerLink="TransactionUtil" partnerLinkType="TransactionUtil" operation="beginTransaction" operationDesc="public void beginTransaction()" ignoreThrow="false" fork="false">
            <source idx="0" terminal="5,A" />
        </invoke>
        <invoke name="MaterialPackingServiceImpl updatePDADeassignFifoFlag" type="invokebean" description="public void updatePDADeassignFifoFlag(com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String siteName, java.lang.String materialPackingName, java.lang.String receiveActNo)" bounds="894,316,141,105" partnerLink="MaterialPackingServiceImpl" partnerLinkType="MaterialPackingServiceImpl" operation="updatePDADeassignFifoFlag" operationDesc="public void updatePDADeassignFifoFlag(com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String siteName, java.lang.String materialPackingName, java.lang.String receiveActNo)" ignoreThrow="false" fork="false">
            <source idx="0" terminal="5,A" />
            <input variable="eventInfo" type="com.cim.idm.framework.data.EventInfo" />
            <input variable="siteName" type="java.lang.String" />
            <input variable="boxID" type="java.lang.String" />
            <input variable="receiveActNO" type="java.lang.String" />
        </invoke>
        <invoke name="MaterialPackingServiceImpl cancelPreAssign" type="invokebean" description="public java.lang.String cancelPreAssign(java.lang.String siteName, java.lang.String boxID, java.lang.String receiveActNo, com.cim.idm.framework.data.EventInfo eventInfo)" bounds="1174,377,141,105" partnerLink="MaterialPackingServiceImpl" partnerLinkType="MaterialPackingServiceImpl" operation="cancelPreAssign" operationDesc="public java.lang.String cancelPreAssign(java.lang.String siteName, java.lang.String boxID, java.lang.String receiveActNo, com.cim.idm.framework.data.EventInfo eventInfo)" ignoreThrow="false" fork="false">
            <source idx="0" terminal="5,A" />
            <input variable="siteName" type="java.lang.String" />
            <input variable="boxID" type="java.lang.String" />
            <input variable="receiveActNO" type="java.lang.String" />
            <input variable="eventInfo" type="com.cim.idm.framework.data.EventInfo" />
            <output variable="shipRequestName" />
        </invoke>
        <invoke name="TransactionUtil commitTransaction" type="invokebean" description="public void commitTransaction()" bounds="1174,512,141,105" partnerLink="TransactionUtil" partnerLinkType="TransactionUtil" operation="commitTransaction" operationDesc="public void commitTransaction()">
            <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="1174,647,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="PDADessignPreShipRequestToBox" type="org.jdom.Document" />
            <input constant="PDASender" type="java.lang.String" />
        </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="1174,782,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="shipRequest" />
        </invoke>
        <expression name="expression" type="expression" bounds="1174,917,141,65">
            <source idx="0" terminal="5,A" />
            <function value="setVariable('deliveryType',getField('shipRequest','deliveryType'))" />
            <function value="setVariable('shipRequestDetailType',getField('shipRequest','shipRequestDetailType'))" />
        </expression>
        <switch name="switch" bounds="1228,1012,33,33" type="switch">
            <source idx="0" terminal="5,A" />
            <switchstart name="switchstart" type="switchstart" bounds="1189,1091,110,49">
                <source idx="0" terminal="5,A" />
            </switchstart>
            <case name="case" type="case" condition="getVariable('deliveryType') = 'Reserve'" bounds="920,1170,60,49">
                <source idx="0" terminal="5,A" />
                <invoke name="ERPInterfaceServiceImpl queryAssignedBoxCount" type="invokebean" description="public int queryAssignedBoxCount(java.lang.String siteName, java.lang.String shipRequestName)" bounds="880,1249,141,105" partnerLink="ERPInterfaceServiceImpl" partnerLinkType="ERPInterfaceServiceImpl" operation="queryAssignedBoxCount" operationDesc="public int queryAssignedBoxCount(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="assignedBoxCount" />
                </invoke>
                <switch name="switch" bounds="934,1384,33,33" type="switch">
                    <source idx="0" terminal="5,A" />
                    <switchstart name="switchstart" type="switchstart" bounds="895,1463,110,49">
                        <source idx="0" terminal="5,A" />
                    </switchstart>
                    <case name="case" type="case" condition="string(getVariable('assignedBoxCount')) = 0" bounds="511,1542,91,70">
                        <source idx="0" terminal="5,A" />
                        <switch name="switch" bounds="540,1642,33,33" type="switch">
                            <source idx="0" terminal="5,A" />
                            <switchstart name="switchstart" type="switchstart" bounds="501,1721,110,49">
                                <source idx="0" terminal="5,A" />
                            </switchstart>
                            <case name="case" type="case" condition="getVariable('siteName') = 'B11'&#xA; or getVariable('siteName') = 'B4'&#xA; or getVariable('siteName') = 'B2'&#xA; or getVariable('siteName') = 'BMOT'&#xA; or getVariable('siteName') = 'B7'" bounds="114,1800,60,63">
                                <source idx="0" terminal="5,A" />
                                <invoke name="ERPInterfaceServiceImpl sendAssignInfo" type="invokebean" description="public static java.util.List sendAssignInfo(java.lang.String siteName, com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String messageID, java.lang.String receiveActNo, java.lang.String shipRequestName, java.lang.String jpFlag)" bounds="74,1893,141,105" partnerLink="ERPInterfaceServiceImpl" partnerLinkType="ERPInterfaceServiceImpl" operation="sendAssignInfo" operationDesc="public static java.util.List sendAssignInfo(java.lang.String siteName, com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String messageID, java.lang.String receiveActNo, java.lang.String shipRequestName, java.lang.String jpFlag)" ignoreThrow="false" fork="false">
                                    <source idx="0" terminal="5,A" />
                                    <input variable="siteName" type="java.lang.String" />
                                    <input variable="eventInfo" type="com.cim.idm.framework.data.EventInfo" />
                                    <input constant="" type="java.lang.String" />
                                    <input variable="receiveActNO" type="java.lang.String" />
                                    <input variable="shipRequestName" type="java.lang.String" />
                                    <input constant="00" type="java.lang.String" />
                                </invoke>
                            </case>
                            <case name="case" type="case" condition="getVariable('siteName') = 'B1'" bounds="395,1800,60,53">
                                <source idx="0" terminal="5,A" />
                                <switch name="switch" bounds="409,1883,33,33" type="switch">
                                    <source idx="0" terminal="5,A" />
                                    <switchstart name="switchstart" type="switchstart" bounds="370,1962,110,49">
                                        <source idx="0" terminal="5,A" />
                                    </switchstart>
                                    <case name="case" type="case" condition="getVariable('shipRequestDetailType')='ZDLF'&#xD;&#xA; or getVariable('shipRequestDetailType')='NLCC'&#xD;&#xA; or getVariable('shipRequestDetailType')='ZELF'" bounds="306,2041,60,53">
                                        <source idx="0" terminal="5,A" />
                                        <invoke name="ERPInterfaceServiceImpl sendAssignInfo" type="invokebean" description="public static java.util.List sendAssignInfo(java.lang.String siteName, com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String messageID, java.lang.String receiveActNo, java.lang.String shipRequestName, java.lang.String jpFlag)" bounds="266,2124,141,105" partnerLink="ERPInterfaceServiceImpl" partnerLinkType="ERPInterfaceServiceImpl" operation="sendAssignInfo" operationDesc="public static java.util.List sendAssignInfo(java.lang.String siteName, com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String messageID, java.lang.String receiveActNo, java.lang.String shipRequestName, java.lang.String jpFlag)" ignoreThrow="false" fork="false">
                                            <source idx="0" terminal="5,A" />
                                            <input variable="siteName" type="java.lang.String" />
                                            <input variable="eventInfo" type="com.cim.idm.framework.data.EventInfo" />
                                            <input constant="" type="java.lang.String" />
                                            <input variable="receiveActNO" type="java.lang.String" />
                                            <input variable="shipRequestName" type="java.lang.String" />
                                            <input constant="00" type="java.lang.String" />
                                        </invoke>
                                    </case>
                                    <otherwise name="otherwise" type="otherwise" bounds="471,2041,88,61">
                                        <source idx="0" terminal="5,A" />
                                    </otherwise>
                                    <switchend name="switchend" type="switchend" bounds="370,2249,110,49">
                                        <source idx="0" terminal="5,A" />
                                        <source idx="1" terminal="5,A" />
                                    </switchend>
                                </switch>
                            </case>
                            <otherwise name="otherwise" type="otherwise" bounds="643,1800,88,71">
                                <source idx="0" terminal="5,A" />
                            </otherwise>
                            <case name="case" type="case" condition="getVariable('siteName') = 'B17'" bounds="922,1800,60,72">
                                <source idx="0" terminal="5,A" />
                                <switch name="switch" bounds="936,1902,33,33" type="switch">
                                    <source idx="0" terminal="5,A" />
                                    <switchstart name="switchstart" type="switchstart" bounds="897,1981,110,49">
                                        <source idx="0" terminal="5,A" />
                                    </switchstart>
                                    <case name="case" type="case" condition="getField(getVariable('shipRequest'), 'customerNO')='MDL'" bounds="731,2060,60,55">
                                        <source idx="0" terminal="5,A" />
                                        <invoke name="XmlUtil clone" type="invokebean" description="public org.jdom.Document clone(org.jdom.Document doc)" bounds="691,2145,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="PDADessignPreShipRequestToBox" type="org.jdom.Document" />
                                            <output variable="toMESMessage" />
                                        </invoke>
                                        <expression name="expression" type="expression" bounds="691,2280,141,65">
                                            <source idx="0" terminal="5,A" />
                                            <function value="setXmlData('toMESMessage','/Message/Header/MESSAGENAME','CallMaterialStartCancel')" />
                                            <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 sendBySender" type="invokebean" description="public void sendBySender(org.jdom.Document doc, java.lang.String senderName)" bounds="691,2375,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="MESSender" type="java.lang.String" />
                                        </invoke>
                                    </case>
                                    <case name="case" type="case" condition="getField(getVariable('shipRequest'), 'customerNO')='FAB'" bounds="922,2060,60,51">
                                        <source idx="0" terminal="5,A" />
                                        <invoke name="XmlUtil clone" type="invokebean" description="public org.jdom.Document clone(org.jdom.Document doc)" bounds="882,2141,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="PDADessignPreShipRequestToBox" type="org.jdom.Document" />
                                            <output variable="toMESMessage" />
                                        </invoke>
                                        <expression name="expression" type="expression" bounds="882,2276,141,65">
                                            <source idx="0" terminal="5,A" />
                                            <function value="setXmlData('toMESMessage','/Message/Header/MESSAGENAME','CallMaterialStartCancel')" />
                                            <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 sendBySender" type="invokebean" description="public void sendBySender(org.jdom.Document doc, java.lang.String senderName)" bounds="882,2371,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>
                                    </case>
                                    <otherwise name="otherwise" type="otherwise" bounds="1087,2060,88,54">
                                        <source idx="0" terminal="5,A" />
                                    </otherwise>
                                    <switchend name="switchend" type="switchend" bounds="897,2500,110,49">
                                        <source idx="0" terminal="5,A" />
                                        <source idx="1" terminal="5,A" />
                                        <source idx="2" terminal="5,A">
                                            <BendPoint FirstRelative="-54,351" SecondRelative="125,-36" weight="0.5" />
                                        </source>
                                    </switchend>
                                </switch>
                            </case>
                            <switchend name="switchend" type="switchend" bounds="501,2569,110,49">
                                <source idx="0" terminal="5,A" />
                                <source idx="1" terminal="5,A" />
                                <source idx="2" terminal="5,A" />
                                <source idx="3" terminal="5,A" />
                            </switchend>
                        </switch>
                    </case>
                    <otherwise name="otherwise" type="otherwise" bounds="1280,1542,131,70">
                        <source idx="0" terminal="5,A" />
                    </otherwise>
                    <switchend name="switchend" type="switchend" bounds="501,2638,110,49">
                        <source idx="0" terminal="5,A" />
                        <source idx="1" terminal="5,A">
                            <BendPoint FirstRelative="-14,516" SecondRelative="775,-511" weight="0.5" />
                            <BendPoint FirstRelative="-304,1328" SecondRelative="657,-142" weight="0.5" />
                        </source>
                    </switchend>
                </switch>
            </case>
            <otherwise name="otherwise" type="otherwise" bounds="1495,1170,88,57">
                <source idx="0" terminal="5,A" />
            </otherwise>
            <switchend name="switchend" type="switchend" bounds="501,2707,110,49">
                <source idx="0" terminal="5,A" />
                <source idx="1" terminal="5,A">
                    <BendPoint FirstRelative="-3,617" SecondRelative="444,-289" weight="0.5" />
                    <BendPoint FirstRelative="-434,1751" SecondRelative="721,-173" weight="0.5" />
                </source>
            </switchend>
        </switch>
        <terminate name="terminate" bounds="486,2786,141,65">
            <source idx="0" terminal="5,A" />
        </terminate>
    </sequence>
</process>

