<?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="PCBACreateBoxByLabel.bpel">
    <partnerLinks>
        <partnerLink name="bpelj" partnerLinkType="bpel:bpelj" />
        <partnerLink name="TransactionUtil" partnerLinkType="bean:TransactionUtil" />
        <partnerLink name="EventInfoUtil" partnerLinkType="bean:EventInfoUtil" />
        <partnerLink name="MaterialPackingServiceImpl" partnerLinkType="bean:MaterialPackingServiceImpl" />
        <partnerLink name="ESBService" partnerLinkType="bean:ESBService" />
    </partnerLinks>
    <variables>
        <variable name="boxFlag" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/BOXQTYFLAG')" />
        <variable name="boxQuantity" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/MATERIALQUANTITY')" />
        <variable name="CreateStorageSpec" messageType="java.lang.String"></variable>
        <variable name="custom" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/GROUPNO')" />
        <variable name="doc" messageType="org.jdom.Document"></variable>
        <variable name="erpFactory" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/ERPFACTORY')" />
        <variable name="erpLocation" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/ERPLOCATION')" />
        <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="EveryBoxQuantity" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/MATERIALCREATEQUANTITY')" />
        <variable name="EXPIRINGDATE" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/EXPIRINGDATE')" />
        <variable name="Flag" messageType="java.lang.String"></variable>
        <variable name="listMaterialPacking" messageType="java.lang.String"></variable>
        <variable name="makeDate" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/MAKEDATE')" />
        <variable name="materialPackingName" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/MATERIALPACKINGNAME')" />
        <variable name="materialSpecName" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/MATERIALSPECNAME')" />
        <variable name="message" messageType="org.jdom.Document"></variable>
        <variable name="moveType" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/MOVETYPE')" />
        <variable name="N" messageType="java.lang.String"></variable>
        <variable name="OICSender" messageType="java.lang.String"></variable>
        <variable name="PalletID" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/SUPERMATERIALPACKINGNAME')" />
        <variable name="poDetailName" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/RECEIVEREQUESTDETAILNAME')" />
        <variable name="receiveActNo" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/RECEIVEACTNO')" />
        <variable name="receiveQty" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/RECEIVEQTY')" />
        <variable name="receiveQuantity" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/RECEIVEQTY')" />
        <variable name="receiveRequestName" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/RECEIVEREQUESTNAME')" />
        <variable name="replySubjectName" messageType="java.lang.String" expression="getXmlData('message', '//Message/Header/ORIGINALSOURCESUBJECTNAME')" />
        <variable name="siteName" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/SITENAME')" />
        <variable name="supplierName" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/SUPPLIERNAME')" />
        <variable name="TrackOutBox" messageType="org.jdom.Document"></variable>
    </variables>
    <sequence>
        <receive name="PCBACreateBoxByLabel" bounds="159,30,149,81">
            <input variable="message" type="org.jdom.Document" />
        </receive>
        <invoke name="TransactionUtil beginTransaction" type="invokebean" description="public void beginTransaction()" bounds="163,141,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="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="163,276,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="PCBACreateBoxByLabel" 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="217,411,33,33" type="switch">
            <source idx="0" terminal="5,A" />
            <switchstart name="switchstart" type="switchstart" bounds="178,490,110,49">
                <source idx="0" terminal="5,A" />
            </switchstart>
            <case name="case" type="case" condition="getVariable('receiveActNo') = ''" bounds="114,569,60,19">
                <source idx="0" terminal="5,A" />
                <invoke name="MaterialPackingServiceImpl findActNoForPCBA" type="invokebean" description="public java.lang.String findActNoForPCBA(com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String receiveRequestName, java.lang.String siteName, java.lang.String actType)" bounds="74,618,141,105" partnerLink="MaterialPackingServiceImpl" partnerLinkType="MaterialPackingServiceImpl" operation="findActNoForPCBA" operationDesc="public java.lang.String findActNoForPCBA(com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String receiveRequestName, java.lang.String siteName, java.lang.String actType)" ignoreThrow="false" fork="false">
                    <source idx="0" terminal="5,A" />
                    <input variable="eventInfo" type="com.cim.idm.framework.data.EventInfo" />
                    <input variable="receiveRequestName" type="java.lang.String" />
                    <input variable="siteName" type="java.lang.String" />
                    <input constant="Normal" type="java.lang.String" />
                    <output variable="receiveActNo" />
                </invoke>
            </case>
            <otherwise name="otherwise" type="otherwise" bounds="279,569,88,19">
                <source idx="0" terminal="5,A" />
            </otherwise>
            <switchend name="switchend" type="switchend" bounds="309,743,110,49">
                <source idx="0" terminal="5,A" />
                <source idx="1" terminal="5,A" />
            </switchend>
        </switch>
        <invoke name="MaterialPackingServiceImpl getPCBADetail" type="invokebean" description="public java.lang.String getPCBADetail(java.lang.String receiveRequestName, java.lang.String materialSpecName, java.lang.String materialQuantity)" bounds="294,822,141,105" partnerLink="MaterialPackingServiceImpl" partnerLinkType="MaterialPackingServiceImpl" operation="getPCBADetail" operationDesc="public java.lang.String getPCBADetail(java.lang.String receiveRequestName, java.lang.String materialSpecName, java.lang.String materialQuantity)" ignoreThrow="false" fork="false">
            <source idx="0" terminal="5,A" />
            <input variable="receiveRequestName" type="java.lang.String" />
            <input variable="materialSpecName" type="java.lang.String" />
            <input variable="receiveQuantity" type="java.lang.String" />
            <output variable="poDetailName" />
        </invoke>
        <invoke name="MaterialPackingServiceImpl PCBACreateBoxByLabel" type="invokebean" description="public void PCBACreateBoxByLabel(com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String siteName, java.lang.String receiveActNo, java.lang.String receiveRequestName, java.lang.String materialPackingName, java.lang.String poDetailName, java.lang.String makeDate, java.lang.String receiveQuantity, java.lang.String materialSpecName, java.lang.String supplierName, java.lang.String NPFlag, java.lang.String palletID, java.lang.String EXPIRINGDATE, java.lang.String erpFactory, java.lang.String erpLocation, java.lang.String moveType)" bounds="294,957,141,105" partnerLink="MaterialPackingServiceImpl" partnerLinkType="MaterialPackingServiceImpl" operation="PCBACreateBoxByLabel" operationDesc="public void PCBACreateBoxByLabel(com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String siteName, java.lang.String receiveActNo, java.lang.String receiveRequestName, java.lang.String materialPackingName, java.lang.String poDetailName, java.lang.String makeDate, java.lang.String receiveQuantity, java.lang.String materialSpecName, java.lang.String supplierName, java.lang.String NPFlag, java.lang.String palletID, java.lang.String EXPIRINGDATE, java.lang.String erpFactory, java.lang.String erpLocation, java.lang.String moveType)" 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="receiveActNo" type="java.lang.String" />
            <input variable="receiveRequestName" type="java.lang.String" />
            <input variable="materialPackingName" type="java.lang.String" />
            <input variable="poDetailName" type="java.lang.String" />
            <input variable="makeDate" type="java.lang.String" />
            <input variable="receiveQuantity" type="java.lang.String" />
            <input variable="materialSpecName" type="java.lang.String" />
            <input variable="supplierName" type="java.lang.String" />
            <input constant="N" type="java.lang.String" />
            <input variable="PalletID" type="java.lang.String" />
            <input variable="EXPIRINGDATE" type="java.lang.String" />
            <input variable="erpFactory" type="java.lang.String" />
            <input variable="erpLocation" type="java.lang.String" />
            <input variable="moveType" type="java.lang.String" />
        </invoke>
        <switch name="switch" bounds="348,1092,33,33" type="switch">
            <source idx="0" terminal="5,A" />
            <switchstart name="switchstart" type="switchstart" bounds="309,1171,110,49">
                <source idx="0" terminal="5,A" />
            </switchstart>
            <case name="case" type="case" condition="getVariable('siteName') = 'B17'&#xD;&#xA;and (starts-with(getVariable('materialSpecName'),'44-977') or starts-with(getVariable('materialSpecName'),'44-971'))" bounds="203,1250,60,60">
                <source idx="0" terminal="5,A" />
                <invoke name="MaterialPackingServiceImpl updateTrayInfo" type="invokebean" description="public void updateTrayInfo(com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String siteName, java.lang.String materialPackingName, java.lang.String flag)" bounds="163,1340,141,105" partnerLink="MaterialPackingServiceImpl" partnerLinkType="MaterialPackingServiceImpl" operation="updateTrayInfo" operationDesc="public void updateTrayInfo(com.cim.idm.framework.data.EventInfo eventInfo, java.lang.String siteName, java.lang.String materialPackingName, java.lang.String flag)" 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="materialPackingName" type="java.lang.String" />
                    <input constant="Create" type="java.lang.String" />
                </invoke>
            </case>
            <otherwise name="otherwise" type="otherwise" bounds="451,1250,88,55">
                <source idx="0" terminal="5,A" />
            </otherwise>
            <switchend name="switchend" type="switchend" bounds="309,1465,110,49">
                <source idx="0" terminal="5,A" />
                <source idx="1" terminal="5,A" />
            </switchend>
        </switch>
        <invoke name="TransactionUtil commitTransaction" type="invokebean" description="public void commitTransaction()" bounds="294,1544,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="294,1679,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>

