<?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="PDAPackingSendtoFAB.bpel">
    <partnerLinks>
        <partnerLink name="bpelj" partnerLinkType="bpel:bpelj" />
        <partnerLink name="EventInfoUtil" partnerLinkType="bean:EventInfoUtil" />
        <partnerLink name="MaterialShipRequestServiceImpl" partnerLinkType="bean:MaterialShipRequestServiceImpl" />
        <partnerLink name="XmlUtil" partnerLinkType="bean:XmlUtil" />
        <partnerLink name="ESBService" partnerLinkType="bean:ESBService" />
    </partnerLinks>
    <variables>
        <variable name="Confirmed" messageType="java.lang.String"></variable>
        <variable name="eventComment" messageType="java.lang.String" expression="getXmlData('message', '//Message/Header/EVENTCOMMENT')" />
        <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="message" messageType="org.jdom.Document"></variable>
        <variable name="MESSender" messageType="java.lang.String"></variable>
        <variable name="operationType" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/ACTTYPE')" />
        <variable name="replySubjectName" messageType="java.lang.String" expression="getXmlData('message', '//Message/Header/ORIGINALSOURCESUBJECTNAME')" />
        <variable name="shiprequestName" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/SHIPREQUESTNAME')" />
        <variable name="siteName" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/SITENAME')" />
        <variable name="toMESMessage" messageType="org.jdom.Document"></variable>
    </variables>
    <sequence>
        <receive name="PDAPackingSendtoFAB" bounds="165,30,149,81">
            <input variable="message" 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="169,141,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="PDAPackingSendtoFAB" 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>
        <switch name="switch" bounds="223,276,33,33" type="switch">
            <source idx="0" terminal="5,A" />
            <switchstart name="switchstart" type="switchstart" bounds="184,355,110,49">
                <source idx="0" terminal="5,A" />
            </switchstart>
            <case name="case" type="case" condition="getVariable('operationType') = 'Confirm'" bounds="114,434,60,67">
                <source idx="0" terminal="5,A" />
                <invoke name="MaterialShipRequestServiceImpl updateSending" type="invokebean" description="public void updateSending(com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String siteName, java.lang.String invoiceNo, java.lang.String shipRequestState)" bounds="74,531,141,105" partnerLink="MaterialShipRequestServiceImpl" partnerLinkType="MaterialShipRequestServiceImpl" operation="updateSending" operationDesc="public void updateSending(com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String siteName, java.lang.String invoiceNo, java.lang.String shipRequestState)" 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="shiprequestName" type="java.lang.String" />
                    <input constant="Sending" type="java.lang.String" />
                </invoke>
                <invoke name="XmlUtil clone" type="invokebean" description="public org.jdom.Document clone(org.jdom.Document doc)" bounds="74,666,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,801,141,65">
                    <source idx="0" terminal="5,A" />
                    <function value="setXmlData('toMESMessage','/Message/Header/MESSAGENAME','CallMaterialSend')" />
                    <function value="removeElement('toMESMessage','/Message/Body')" />
                    <function value="addChildNode('toMESMessage','/Message',createNode('Body',''))" />
                    <function value="addElement('toMESMessage','/Message/Body','SHIPREQUESTNAME',getVariable('shiprequestName'))" />
                    <function value="addElement('toMESMessage','/Message/Body','COMMENT','')" />
                </expression>
                <invoke name="ESBService sendBySender" type="invokebean" description="public void sendBySender(org.jdom.Document doc, java.lang.String senderName)" bounds="74,896,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>
            <case name="case" type="case" condition="getVariable('operationType') = 'Cancel'" bounds="305,434,60,56">
                <source idx="0" terminal="5,A" />
                <invoke name="MaterialShipRequestServiceImpl updateConfirm" type="invokebean" description="public void updateConfirm(com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String siteName, java.lang.String invoiceNo, java.lang.String shipRequestState)" bounds="265,520,141,105" partnerLink="MaterialShipRequestServiceImpl" partnerLinkType="MaterialShipRequestServiceImpl" operation="updateConfirm" operationDesc="public void updateConfirm(com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String siteName, java.lang.String invoiceNo, java.lang.String shipRequestState)" 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="shiprequestName" type="java.lang.String" />
                    <input constant="Confirmed" type="java.lang.String" />
                </invoke>
            </case>
            <switchend name="switchend" type="switchend" bounds="184,1021,110,49">
                <source idx="0" terminal="5,A" />
                <source idx="1" terminal="5,A" />
            </switchend>
        </switch>
        <invoke name="ESBService sendReplyBySender" type="invokebean" description="public void sendReplyBySender(java.lang.String replySubject, org.jdom.Document doc, java.lang.String senderName)" bounds="169,1100,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="message" type="org.jdom.Document" />
            <input constant="PDASender" type="java.lang.String" />
        </invoke>
    </sequence>
</process>

