<?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="ModifyLimitedMaterialSpe.bpel">
    <partnerLinks>
        <partnerLink name="bpelj" partnerLinkType="bpel:bpelj" />
        <partnerLink name="EventInfoUtil" partnerLinkType="bean:EventInfoUtil" />
        <partnerLink name="TransactionUtil" partnerLinkType="bean:TransactionUtil" />
        <partnerLink name="MaterialShipRequestServiceImpl" partnerLinkType="bean:MaterialShipRequestServiceImpl" />
        <partnerLink name="ESBService" partnerLinkType="bean:ESBService" />
    </partnerLinks>
    <variables>
        <variable name="0" messageType="java.lang.String"></variable>
        <variable name="batchFlag" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/BOARDFLAG')" />
        <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="flag" messageType="java.lang.String"></variable>
        <variable name="isUsed" messageType="java.lang.String"></variable>
        <variable name="limitedQuantity" messageType="java.lang.String"></variable>
        <variable name="materialspec" messageType="java.lang.String"></variable>
        <variable name="materialspecElement" messageType="org.jdom.Element"></variable>
        <variable name="materialspecList" messageType="java.util.ArrayList"></variable>
        <variable name="materialSpecName" messageType="java.lang.String"></variable>
        <variable name="message" messageType="org.jdom.Document"></variable>
        <variable name="OICSender" messageType="java.lang.String"></variable>
        <variable name="replySubjectName" messageType="java.lang.String" expression="getXmlData('message', '//Message/Header/ORIGINALSOURCESUBJECTNAME')" />
        <variable name="siteName" messageType="java.lang.String" expression="getXmlData('message', '//Message/Header/SITENAME')" />
        <variable name="totalQty" messageType="java.lang.String"></variable>
    </variables>
    <sequence>
        <receive name="ModifyLimitedMaterialSpe" bounds="70,30,142,80">
            <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="71,140,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="ModifyLimitedMaterialSpe" 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="90,275,33,33" type="switch">
            <source idx="0" terminal="5,A" />
            <switchstart name="switchstart" type="switchstart" bounds="86,354,110,49">
                <source idx="0" terminal="5,A" />
            </switchstart>
            <case name="case" type="case" condition="string(getVariable('batchFlag')) = '1'" bounds="111,433,60,19">
                <source idx="0" terminal="5,A" />
                <expression name="expression" type="expression" bounds="71,482,141,65">
                    <source idx="0" terminal="5,A" />
                    <function value="setVariable('materialspecList',getElementList('message','//MATERIALSPEC'))" />
                </expression>
                <invoke name="TransactionUtil beginTransaction" type="invokebean" description="public void beginTransaction()" bounds="71,577,141,105" partnerLink="TransactionUtil" partnerLinkType="TransactionUtil" operation="beginTransaction" operationDesc="public void beginTransaction()" ignoreThrow="false" fork="false">
                    <source idx="0" terminal="5,A" />
                </invoke>
                <while name="while" bounds="125,712,32,32" type="2" collection="materialspecList" element="materialspecElement">
                    <source idx="0" terminal="5,A" />
                    <whilestart name="whilestart" type="whilestart" bounds="86,791,110,49">
                        <source idx="0" terminal="5,A" />
                    </whilestart>
                    <expression name="expression" type="expression" bounds="71,870,141,65">
                        <source idx="0" terminal="5,A" />
                        <function value="setVariable('materialSpecName',getXmlData('materialspecElement','//MATERIALSPECNAME'))" />
                        <function value="setVariable('limitedQuantity',getXmlData('materialspecElement','//LIMITEDQUANTITY'))" />
                        <function value="setVariable('flag',getXmlData('materialspecElement','//FLAG'))" />
                    </expression>
                    <invoke name="MaterialShipRequestServiceImpl saveLimitedMaterialspec" type="invokebean" description="public void saveLimitedMaterialspec(java.lang.String materialSpecName, java.lang.String limitedQuantiry, java.lang.String receivedQuantity, java.lang.String isUsed, java.lang.String siteName, com.cim.idm.framework.data.EventInfo eventInfo)" bounds="71,965,141,105" partnerLink="MaterialShipRequestServiceImpl" partnerLinkType="MaterialShipRequestServiceImpl" operation="saveLimitedMaterialspec" operationDesc="public void saveLimitedMaterialspec(java.lang.String materialSpecName, java.lang.String limitedQuantiry, java.lang.String receivedQuantity, java.lang.String isUsed, java.lang.String siteName, com.cim.idm.framework.data.EventInfo eventInfo)" ignoreThrow="false" fork="false">
                        <source idx="0" terminal="5,A" />
                        <input variable="materialSpecName" type="java.lang.String" />
                        <input variable="limitedQuantity" type="java.lang.String" />
                        <input constant="0" type="java.lang.String" />
                        <input variable="flag" type="java.lang.String" />
                        <input variable="siteName" type="java.lang.String" />
                        <input variable="eventInfo" type="com.cim.idm.framework.data.EventInfo" />
                    </invoke>
                    <whileend name="whileend" type="whileend" bounds="86,1090,110,49">
                        <source idx="0" terminal="5,A" />
                    </whileend>
                </while>
                <invoke name="TransactionUtil commitTransaction" type="invokebean" description="public void commitTransaction()" bounds="71,1169,141,105" partnerLink="TransactionUtil" partnerLinkType="TransactionUtil" operation="commitTransaction" operationDesc="public void commitTransaction()" ignoreThrow="false" fork="false">
                    <source idx="0" terminal="5,A" />
                </invoke>
            </case>
            <otherwise name="otherwise" type="otherwise" bounds="276,433,88,19">
                <source idx="0" terminal="5,A" />
                <expression name="expression" type="expression" bounds="305,484,141,65">
                    <source idx="0" terminal="5,A" />
                    <function value="setVariable('materialspec',getXmlData('message', '//Message/Body/MATERIALSPECNAME'))" />
                    <function value="setVariable('totalQty',getXmlData('message', '//Message/Body/LIMITEDQUANTITY'))" />
                    <function value="setVariable('isUsed',getXmlData('message', '//Message/Body/FLAG'))" />
                </expression>
                <invoke name="MaterialShipRequestServiceImpl saveLimitedMaterialspec" type="invokebean" description="public void saveLimitedMaterialspec(java.lang.String materialSpecName, java.lang.String limitedQuantiry, java.lang.String receivedQuantity, java.lang.String isUsed, java.lang.String siteName, com.cim.idm.framework.data.EventInfo eventInfo)" bounds="303,643,141,105" partnerLink="MaterialShipRequestServiceImpl" partnerLinkType="MaterialShipRequestServiceImpl" operation="saveLimitedMaterialspec" operationDesc="public void saveLimitedMaterialspec(java.lang.String materialSpecName, java.lang.String limitedQuantiry, java.lang.String receivedQuantity, java.lang.String isUsed, java.lang.String siteName, com.cim.idm.framework.data.EventInfo eventInfo)" ignoreThrow="false" fork="false">
                    <source idx="0" terminal="5,A" />
                    <input variable="materialspec" type="java.lang.String" />
                    <input variable="totalQty" type="java.lang.String" />
                    <input constant="0" type="java.lang.String" />
                    <input variable="isUsed" type="java.lang.String" />
                    <input variable="siteName" type="java.lang.String" />
                    <input variable="eventInfo" type="com.cim.idm.framework.data.EventInfo" />
                </invoke>
            </otherwise>
            <switchend name="switchend" type="switchend" bounds="86,1294,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="71,1373,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="OICSender" type="java.lang.String" />
        </invoke>
    </sequence>
</process>

