<?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="dispatching.bpel">
    <partnerLinks>
        <partnerLink name="bpelj" partnerLinkType="bpel:bpelj" />
        <partnerLink name="TransactionUtil" partnerLinkType="bean:TransactionUtil" />
        <partnerLink name="ESBService" partnerLinkType="bean:ESBService" />
        <partnerLink name="BpelExecuter" partnerLinkType="bean:BpelExecuter" />
    </partnerLinks>
    <variables>
        <variable name="error" messageType="java.lang.Exception"></variable>
        <variable name="language" messageType="java.lang.String" expression="getXmlData('message', '//Message/Body/LANGUAGE')" />
        <variable name="message" messageType="org.jdom.Document"></variable>
        <variable name="msg" messageType="java.lang.String" expression="getXmlData('message', '//Message/Header/MESSAGENAME')" />
        <variable name="replySubjectName" messageType="java.lang.String" expression="getXmlData('message', '//Message/Header/ORIGINALSOURCESUBJECTNAME')" />
        <variable name="serverName" messageType="java.lang.String"></variable>
    </variables>
    <faultHandlers name="faultHandlers" bounds="520,113,413,468">
        <catchAll name="catchAll" type="catchAll" bounds="31,70,360,365">
            <invoke name="TransactionUtil rollbackTransaction" type="invokebean" description="public void rollbackTransaction()" bounds="108,11,141,105" partnerLink="TransactionUtil" partnerLinkType="TransactionUtil" operation="rollbackTransaction" operationDesc="public void rollbackTransaction()" ignoreThrow="false" fork="false" />
            <invoke name="ESBService sendErrorBySender" type="invokebean" description="public void sendErrorBySender(String replySubject, org.jdom.Document doc, String lanuage, Exception e, String senderName)" bounds="31,131,300,102" partnerLink="ESBService" partnerLinkType="ESBService" operation="sendErrorBySender" operationDesc="public void sendErrorBySender(String replySubject, org.jdom.Document doc, String lanuage, Exception e, 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 variable="language" type="java.lang.String" />
                <input variable="error" type="java.lang.Exception" />
                <input constant="ERPSender" type="java.lang.String" />
            </invoke>
            <invoke name="ESBService makeErrorMessageLog" type="invokebean" description="public java.lang.String makeErrorMessageLog(org.jdom.Document doc, java.lang.Exception e, java.lang.String language)" bounds="104,246,152,102" partnerLink="ESBService" partnerLinkType="ESBService" operation="makeErrorMessageLog" operationDesc="public java.lang.String makeErrorMessageLog(org.jdom.Document doc, java.lang.Exception e, java.lang.String language)" ignoreThrow="false" fork="false">
                <source idx="0" terminal="5,A" />
                <input variable="message" type="org.jdom.Document" />
                <input variable="error" type="java.lang.Exception" />
                <input variable="language" type="java.lang.String" />
            </invoke>
        </catchAll>
    </faultHandlers>
    <sequence>
        <receive name="dispatching{SEQ}0" bounds="85,45,140,75">
            <input variable="message" type="org.jdom.Document" />
        </receive>
        <switch name="switch" bounds="139,150,33,33" type="switch">
            <source idx="0" terminal="5,A" />
            <switchstart name="switchstart" type="switchstart" bounds="100,229,110,49">
                <source idx="0" terminal="5,A" />
            </switchstart>
            <case name="case" type="case" condition="getXmlData('message', '//Message/Header/MESSAGENAME') = 'GetQueryResult'" bounds="139,308,32,49">
                <source idx="0" terminal="5,A" />
                <invoke name="Query.bpel" type="invokewf" partnerLink="bpelj" partnerLinkType="bpel" bounds="85,387,140,89" operation="Query.bpel" ignoreThrow="false" fork="false">
                    <source idx="0" terminal="5,A" />
                    <input variable="message" />
                </invoke>
            </case>
            <otherwise name="otherwise" type="otherwise" bounds="315,308,61,49">
                <source idx="0" terminal="5,A" />
                <invoke name="BpelExecuter insertMessageLog" type="invokebean" description="public static void insertMessageLog(org.jdom.Document doc, java.lang.String serverName)" bounds="285,372,140,102" partnerLink="BpelExecuter" partnerLinkType="BpelExecuter" operation="insertMessageLog" operationDesc="public static void insertMessageLog(org.jdom.Document doc, java.lang.String serverName)" ignoreThrow="false" fork="false">
                    <source idx="0" terminal="5,A" />
                    <input variable="message" type="org.jdom.Document" />
                    <input constant="ERPsvr" type="java.lang.String" />
                </invoke>
                <invoke name="PDAexecuteWF" type="invokebean" description="public void executeWF(org.jdom.Document document)" bounds="282,509,141,105" partnerLink="BpelExecuter" partnerLinkType="BpelExecuter" operation="executeWF" operationDesc="public void executeWF(org.jdom.Document document)" ignoreThrow="false" fork="false">
                    <source idx="0" terminal="5,A" />
                    <input variable="message" type="org.jdom.Document" />
                    <fault faultName="catchAll" variable="error" />
                </invoke>
            </otherwise>
            <switchend name="switchend" type="switchend" bounds="120,649,110,49">
                <source idx="0" terminal="5,A" />
                <source idx="1" terminal="5,A" />
            </switchend>
        </switch>
        <terminate name="terminate" bounds="97,736,140,62">
            <source idx="0" terminal="5,A" />
        </terminate>
    </sequence>
</process>

