<?xml version="1.0" encoding="euc-kr"?>
<process xmlns:bean="http://bean.boe.com/" xmlns:bpel="http://bpel.boe.com/" targetNamespace="http://bpel.boe.com/bpelj/" name="GoToRTPallet.bpel">
    <partnerLinks>
        <partnerLink name="bpelj" partnerLinkType="bpel:bpelj" />
        <partnerLink name="TransactionUtil" partnerLinkType="bean:TransactionUtil" />
        <partnerLink name="PackingGroupServiceUtil" partnerLinkType="bean:PackingGroupServiceUtil" />
        <partnerLink name="CommonUtil" partnerLinkType="bean:CommonUtil" />
        <partnerLink name="EventInfoUtil" partnerLinkType="bean:EventInfoUtil" />
        <partnerLink name="PackingGroupServiceImpl" partnerLinkType="bean:PackingGroupServiceImpl" />
        <partnerLink name="ESBService" partnerLinkType="bean:ESBService" />
        <partnerLink name="ERPInterfaceServiceImpl" partnerLinkType="bean:ERPInterfaceServiceImpl" />
    </partnerLinks>
    <variables>
        <variable name="body" messageType="org.jdom.Element" expression="getXmlElement('message', '//Message/Body')" />
        <variable name="customException" messageType="com.cim.idm.fgwmsextend.generic.errorHandler.CustomException"></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="eventName" messageType="java.lang.String"></variable>
        <variable name="eventUser" messageType="java.lang.String" expression="getXmlData('message', '//Message/Header/EVENTUSER')" />
        <variable name="Hold" messageType="java.lang.String"></variable>
        <variable name="holdCode" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/REASONCODE')" />
        <variable name="index" messageType="int"></variable>
        <variable name="language" messageType="java.lang.String" expression="getXmlData('message', '//Message/Header/LANGUAGE')" />
        <variable name="lotQuantity" messageType="int"></variable>
        <variable name="materialUdfs" messageType="java.util.HashMap"></variable>
        <variable name="message" messageType="org.jdom.Document"></variable>
        <variable name="oqaComment" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/OQACOMMENT')" />
        <variable name="palletElement" messageType="org.jdom.Element"></variable>
        <variable name="palletEtcState" messageType="java.lang.String"></variable>
        <variable name="palletInfo" messageType="com.cim.idm.wmspackage.productpacking.management.data.ProductPacking"></variable>
        <variable name="palletInfoTemp" messageType="com.cim.idm.wmspackage.productpacking.management.data.ProductPacking" expression="newInstance('com.cim.idm.wmspackage.productpacking.management.data.ProductPacking')" />
        <variable name="palletList" messageType="java.util.List"></variable>
        <variable name="palletName" messageType="java.lang.String"></variable>
        <variable name="palletReasonCode" messageType="java.lang.String"></variable>
        <variable name="palletSDERP_ReleaseList" messageType="java.util.List" expression="newInstance('java.util.ArrayList', 10)" />
        <variable name="palletSDERPList" messageType="java.util.List" expression="newInstance('java.util.ArrayList', 10)" />
        <variable name="reasonCodeType" messageType="java.lang.String"></variable>
        <variable name="Release" messageType="java.lang.String"></variable>
        <variable name="releaseHoldEventInfo" messageType="com.cim.idm.framework.data.EventInfo"></variable>
        <variable name="replySubjectName" messageType="java.lang.String" expression="getXmlData('message', '//Message/Header/ORIGINALSOURCESUBJECTNAME')" />
        <variable name="rtreasonCode" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/REASONCODE')" />
        <variable name="siteName" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/SITENAME')" />
        <variable name="typeName" messageType="java.lang.String">ProductPacking</variable>
        <variable name="userColumns" messageType="java.util.Map" expression="newInstance('java.util.HashMap', 10)" />
    </variables>
    <Lane name="Lane" bounds="557,2434,402,80" backgroundcolor="253,250,192" />
    <Lane name="Lane" bounds="112,640,411,80" backgroundcolor="253,250,192" />
    <Lane name="Lane" bounds="48,2183,402,211" backgroundcolor="253,250,192" />
    <Lane name="Lane" bounds="16,1729,460,273" backgroundcolor="253,250,192" />
    <note name="Note" bounds="643,2443,125,-1">Add Hold List that send To ERP for RT.</note>
    <note name="Note" bounds="337,648,176,-1">Save old reasoncode</note>
    <note name="Note" bounds="294,2327,125,-1">Add Release List that send To ERP.</note>
    <note name="Note" bounds="348,2067,134,-1">Release hold's pallet</note>
    <sequence>
        <receive name="GoToRTPallet" bounds="172,30,140,75">
            <input variable="message" type="org.jdom.Document" />
        </receive>
        <invoke name="TransactionUtil beginTransaction" type="invokebean" description="public void beginTransaction()" bounds="172,135,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="PackingGroupServiceUtil checkExistBoxInPallet" type="invokebean" description="public static void checkExistBoxInPallet(java.lang.String siteName, org.jdom.Document message)" bounds="172,270,140,102" partnerLink="PackingGroupServiceUtil" partnerLinkType="PackingGroupServiceUtil" operation="checkExistBoxInPallet" operationDesc="public static void checkExistBoxInPallet(java.lang.String siteName, org.jdom.Document message)" ignoreThrow="false" fork="false">
            <source idx="0" terminal="5,A" />
            <input variable="siteName" type="java.lang.String" />
            <input variable="message" type="org.jdom.Document" />
        </invoke>
        <expression name="expression" type="expression" bounds="172,402,140,62">
            <source idx="0" terminal="5,A" />
            <function value="setVariable('siteName', getElementList('siteName','//SITENAME'))" />
            <function value="setVariable('palletList', getElementList('message','//PALLET'))" />
        </expression>
        <while name="while" bounds="226,494,32,49" type="2" collection="palletList" element="palletElement">
            <source idx="0" terminal="5,A" />
            <whilestart name="whilestart" type="whilestart" bounds="187,573,110,49">
                <source idx="0" terminal="5,A" />
            </whilestart>
            <expression name="expression" type="expression" bounds="172,652,140,62">
                <source idx="0" terminal="5,A" />
                <function value="setVariable('palletName',getXmlData('palletElement','//PALLETNAME'))" />
                <function value="setVariable('palletReasonCode',getXmlData('palletElement','//REASONCODE'))" />
                <function value="setVariable('palletEtcState',getXmlData('palletElement','//ETCSTATE'))" />
            </expression>
            <switch name="switch" bounds="226,744,33,33" type="switch">
                <source idx="0" terminal="5,A" />
                <switchstart name="switchstart" type="switchstart" bounds="187,823,110,49">
                    <source idx="0" terminal="5,A" />
                </switchstart>
                <case name="case" type="case" condition="getVariable('palletEtcState') = 'ETCMRB'" bounds="110,902,60,48">
                    <source idx="0" terminal="5,A" />
                    <expression name="expression" type="expression" bounds="70,980,140,62">
                        <source idx="0" terminal="5,A" />
                        <function value="setVariable('rtreasonCode', 'HD-C-A-Y')" />
                    </expression>
                </case>
                <otherwise name="otherwise" type="otherwise" bounds="301,902,88,50">
                    <source idx="0" terminal="5,A" />
                    <expression name="expression" type="expression" bounds="275,982,140,62">
                        <source idx="0" terminal="5,A" />
                        <function value="setVariable('rtreasonCode', 'HD-C-A-X')" />
                    </expression>
                </otherwise>
                <switchend name="switchend" type="switchend" bounds="484,1064,110,49">
                    <source idx="0" terminal="5,A" />
                    <source idx="1" terminal="5,A" />
                </switchend>
            </switch>
            <invoke name="CommonUtil getPackingGroupInfoByPackingGroupName" type="invokebean" description="public static com.cim.idm.wmspackage.productpacking.management.data.ProductPacking getPackingGroupInfoByPackingGroupName(java.lang.String SiteName, java.lang.String packingGroupName)" bounds="469,1143,141,105" partnerLink="CommonUtil" partnerLinkType="CommonUtil" operation="getPackingGroupInfoByPackingGroupName" operationDesc="public static com.cim.idm.wmspackage.productpacking.management.data.ProductPacking getPackingGroupInfoByPackingGroupName(java.lang.String SiteName, java.lang.String packingGroupName)" ignoreThrow="false" fork="false">
                <source idx="0" terminal="5,A" />
                <input variable="siteName" type="java.lang.String" />
                <input variable="palletName" type="java.lang.String" />
                <output variable="palletInfo" />
            </invoke>
            <invoke name="EventInfoUtil makeEventInfo" type="invokebean" description="public static com.cim.idm.framework.data.EventInfo makeEventInfo(String eventName, String eventUser, String eventComment, String reasonCodeType, String reasonCode)" bounds="372,1278,334,102" partnerLink="EventInfoUtil" partnerLinkType="EventInfoUtil" operation="makeEventInfo" operationDesc="public static com.cim.idm.framework.data.EventInfo makeEventInfo(String eventName, String eventUser, String eventComment, String reasonCodeType, String reasonCode)" ignoreThrow="false" fork="false">
                <source idx="0" terminal="5,A" />
                <input constant="GoToRT" type="java.lang.String" />
                <input variable="eventUser" type="java.lang.String" />
                <input variable="eventComment" type="java.lang.String" />
                <input variable="reasonCodeType" type="java.lang.String" />
                <input variable="rtreasonCode" type="java.lang.String" />
                <output variable="eventInfo" />
            </invoke>
            <switch name="switch" bounds="523,1410,33,33" type="switch">
                <source idx="0" terminal="5,A" />
                <switchstart name="switchstart" type="switchstart" bounds="484,1489,110,49">
                    <source idx="0" terminal="5,A" />
                </switchstart>
                <case name="case" type="case" condition="getPropertyData(getVariable('palletInfo'),'holdState') = 'Y'" bounds="226,1568,32,49">
                    <source idx="0" terminal="5,A" />
                    <switch name="switch" bounds="83,1568,33,33" type="switch">
                        <source idx="0" terminal="5,A" />
                        <switchstart name="switchstart" type="switchstart" bounds="57,1625,110,49">
                            <source idx="0" terminal="5,A" />
                        </switchstart>
                        <case name="case" type="case" condition="1!=1&#xD;&#xA;" bounds="82,1694,60,19">
                            <source idx="0" terminal="5,A" />
                            <expression name="expression" type="expression" bounds="173,1747,140,62">
                                <source idx="0" terminal="5,A" />
                                <function value="addMap(getVariable('userColumns'),'oqaComment',getVariable('oqaComment'))" />
                            </expression>
                            <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="84,1839,319,102" 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="ReleaseHold" 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 variable="palletReasonCode" type="java.lang.String" />
                                <output variable="releaseHoldEventInfo" />
                            </invoke>
                            <invoke name="PackingGroupServiceImpl gotoRT4OnHoldPallet" type="invokebean" description="public void gotoRT4OnHoldPallet(java.lang.String siteName, java.lang.String palletName, com.cim.idm.framework.data.EventInfo eventInfo, java.util.Map userColumns)" bounds="109,1971,268,102" partnerLink="PackingGroupServiceImpl" partnerLinkType="PackingGroupServiceImpl" operation="gotoRT4OnHoldPallet" operationDesc="public void gotoRT4OnHoldPallet(java.lang.String siteName, java.lang.String palletName, com.cim.idm.framework.data.EventInfo eventInfo, java.util.Map userColumns)" ignoreThrow="false" fork="false">
                                <source idx="0" terminal="5,A" />
                                <input variable="siteName" type="java.lang.String" />
                                <input variable="palletName" type="java.lang.String" />
                                <input variable="releaseHoldEventInfo" type="com.cim.idm.framework.data.EventInfo" />
                                <input variable="userColumns" type="java.util.Map" />
                            </invoke>
                            <invoke name="PackingGroupServiceUtil getPackingGroupData" type="invokebean" description="public com.cim.idm.wmspackage.productpacking.management.data.ProductPacking getPackingGroupData(java.lang.String originalPalletName, java.lang.String siteName)" bounds="173,2103,141,105" partnerLink="PackingGroupServiceUtil" partnerLinkType="PackingGroupServiceUtil" operation="getPackingGroupData" operationDesc="public com.cim.idm.wmspackage.productpacking.management.data.ProductPacking getPackingGroupData(java.lang.String originalPalletName, java.lang.String siteName)" ignoreThrow="false" fork="false">
                                <source idx="0" terminal="5,A" />
                                <input variable="palletName" type="java.lang.String" />
                                <input variable="siteName" type="java.lang.String" />
                                <output variable="palletInfoTemp" />
                            </invoke>
                            <expression name="expression" type="expression" bounds="173,2238,141,65">
                                <source idx="0" terminal="5,A" />
                                <function value="setField('palletInfoTemp', 'reasonCode',getVariable('palletReasonCode'))" />
                                <function value="addListValue('palletSDERP_ReleaseList', getVariable('palletInfoTemp'))" />
                            </expression>
                        </case>
                        <otherwise name="otherwise" type="otherwise" bounds="286,1648,88,19">
                            <source idx="0" terminal="5,A" />
                            <throw name="throw" bounds="481,1679,141,65" faultName="CatchAll" variable="customException">
                                <source idx="0" terminal="5,A" />
                                <input constant="PALLET-0112" type="java.lang.String" />
                                <input variable="palletName" type="java.lang.Object" />
                            </throw>
                        </otherwise>
                    </switch>
                </case>
                <case name="case" type="case" condition="getPropertyData(getVariable('palletInfo'),'oqaRtFlag') = 'Y'" bounds="731,1579,69,50">
                    <source idx="0" terminal="5,A" />
                    <throw name="throw" bounds="704,1734,141,65" faultName="CatchAll" variable="customException">
                        <source idx="0" terminal="5,A" />
                        <input constant="PALLET-0112" type="java.lang.String" />
                        <input variable="palletName" type="java.lang.Object" />
                    </throw>
                </case>
                <otherwise name="otherwise" type="otherwise" bounds="990,1579,87,47">
                    <source idx="0" terminal="5,A" />
                    <expression name="expression" type="expression" bounds="964,1756,140,62">
                        <source idx="0" terminal="5,A" />
                        <function value="addMap(getVariable('userColumns'),'oqaComment',getVariable('oqaComment'))" />
                    </expression>
                    <invoke name="PackingGroupServiceImpl gotoRT4NotOnHoldPallet" type="invokebean" description="public void gotoRT4NotOnHoldPallet(java.lang.String siteName, java.lang.String palletName, com.cim.idm.framework.data.EventInfo eventInfo, java.util.Map userColumns)" bounds="900,1848,268,102" partnerLink="PackingGroupServiceImpl" partnerLinkType="PackingGroupServiceImpl" operation="gotoRT4NotOnHoldPallet" operationDesc="public void gotoRT4NotOnHoldPallet(java.lang.String siteName, java.lang.String palletName, com.cim.idm.framework.data.EventInfo eventInfo, java.util.Map userColumns)" ignoreThrow="false" fork="false">
                        <source idx="0" terminal="5,A" />
                        <input variable="siteName" type="java.lang.String" />
                        <input variable="palletName" type="java.lang.String" />
                        <input variable="eventInfo" type="com.cim.idm.framework.data.EventInfo" />
                        <input variable="userColumns" type="java.util.Map" />
                    </invoke>
                </otherwise>
                <switchend name="switchend" type="switchend" bounds="485,2323,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>
            <expression name="expression" type="expression" bounds="475,2446,141,65">
                <source idx="0" terminal="5,A" />
                <function value="setField('palletInfo', 'reasonCode',getVariable('rtreasonCode'))" />
                <function value="addListValue('palletSDERPList', getVariable('palletInfo'))" />
            </expression>
            <whileend name="whileend" type="whileend" bounds="497,2587,110,49">
                <source idx="0" terminal="5,A" />
            </whileend>
        </while>
        <invoke name="ESBService sendReplyBySender" type="invokebean" description="public void sendReplyBySender(String subject, org.jdom.Document doc, String senderName)" bounds="472,2708,224,102" partnerLink="ESBService" partnerLinkType="ESBService" operation="sendReplyBySender" operationDesc="public void sendReplyBySender(String subject, org.jdom.Document doc, 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="OICSender" type="java.lang.String" />
        </invoke>
        <invoke name="TransactionUtil commitTransaction" type="invokebean" description="public void commitTransaction()" bounds="509,2875,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="564,3045,33,33" type="switch">
            <source idx="0" terminal="5,A" />
            <switchstart name="switchstart" type="switchstart" bounds="525,3124,110,49">
                <source idx="0" terminal="5,A" />
            </switchstart>
            <case name="case" type="case" condition="1=1" bounds="513,3203,60,19">
                <source idx="0" terminal="5,A" />
            </case>
            <otherwise name="otherwise" type="otherwise" bounds="573,3203,88,19">
                <source idx="0" terminal="5,A" />
                <invoke name="ERPInterfaceServiceImpl insertBS_ERPIF_LG16" type="invokebean" description="public static void insertBS_ERPIF_LG16(java.lang.String siteName, java.util.List packingGroupList, java.lang.String eventName, java.lang.String erplocation)" bounds="547,3252,140,102" partnerLink="ERPInterfaceServiceImpl" partnerLinkType="ERPInterfaceServiceImpl" operation="insertBS_ERPIF_LG16" operationDesc="public static void insertBS_ERPIF_LG16(java.lang.String siteName, java.util.List packingGroupList, java.lang.String eventName, java.lang.String erplocation)" ignoreThrow="false" fork="false">
                    <source idx="0" terminal="5,A" />
                    <input variable="siteName" type="java.lang.String" />
                    <input variable="palletSDERPList" type="java.util.List" />
                    <input constant="Hold" type="java.lang.String" />
                    <input constant="" type="java.lang.String" />
                </invoke>
            </otherwise>
            <switchend name="switchend" type="switchend" bounds="525,3374,110,49">
                <source idx="0" terminal="5,A" />
                <source idx="1" terminal="5,A" />
            </switchend>
        </switch>
    </sequence>
</process>

