<?xml version="1.0" encoding="UTF-8"?>
<process
    name="travelServiceBPELDiagram"
    targetNamespace="http://enterprise.netbeans.org/bpel/TravelServiceBPEL/travelServiceBPELDiagram"
    xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:tns="http://enterprise.netbeans.org/bpel/TravelServiceBPEL/travelServiceBPELDiagram" xmlns:sxt="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Trace" xmlns:sxed="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Editor" xmlns:ns0="http://xml.netbeans.org/schema/travelXSD">
    <import namespace="http://j2ee.netbeans.org/wsdl/travelWSDL" location="travelWSDL.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
    <import namespace="http://enterprise.netbeans.org/bpel/WestAirlinesWSServiceWrapper" location="Partners/WestAirlinesWS/WestAirlinesWSServiceWrapper.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
    <import namespace="http://wa/" location="Partners/WestAirlinesWS/WestAirlinesWSService.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
    <import namespace="http://enterprise.netbeans.org/bpel/EastAirlinesWSServiceWrapper" location="Partners/EastAirlinesWS/EastAirlinesWSServiceWrapper.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
    <import namespace="http://ea/" location="Partners/EastAirlinesWS/EastAirlinesWSService.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
    <partnerLinks>
        <partnerLink name="WestAirline" xmlns:tns="http://enterprise.netbeans.org/bpel/WestAirlinesWSServiceWrapper" partnerLinkType="tns:WestAirlinesWSLinkType" partnerRole="WestAirlinesWSRole"/>
        <partnerLink name="EastAirline" xmlns:tns="http://enterprise.netbeans.org/bpel/EastAirlinesWSServiceWrapper" partnerLinkType="tns:EastAirlinesWSLinkType" partnerRole="EastAirlinesWSRole"/>
        <partnerLink name="client" xmlns:tns="http://j2ee.netbeans.org/wsdl/travelWSDL" partnerLinkType="tns:travelWSDL" myRole="travelWSDLPortTypeRole"/>
    </partnerLinks>
    <variables>
        <variable name="WABookOut" xmlns:tns="http://wa/" messageType="tns:bookResponse"/>
        <variable name="WABookIn" xmlns:tns="http://wa/" messageType="tns:book"/>
        <variable name="WAGetAvailabilityOut" xmlns:tns="http://wa/" messageType="tns:getAvailabilityResponse"/>
        <variable name="WAGetAvailabilityIn" xmlns:tns="http://wa/" messageType="tns:getAvailability"/>
        <variable name="EABookOut" xmlns:tns="http://ea/" messageType="tns:bookResponse"/>
        <variable name="EABookIn" xmlns:tns="http://ea/" messageType="tns:book"/>
        <variable name="EAGetAvailabilityOut" xmlns:tns="http://ea/" messageType="tns:getAvailabilityResponse"/>
        <variable name="EAGetAvailabilityIn" xmlns:tns="http://ea/" messageType="tns:getAvailability"/>
        <variable name="clientOutput" xmlns:tns="http://j2ee.netbeans.org/wsdl/travelWSDL" messageType="tns:travelWSDLOperationResponse"/>
        <variable name="ClientInput" xmlns:tns="http://j2ee.netbeans.org/wsdl/travelWSDL" messageType="tns:travelWSDLOperationRequest"/>
    </variables>
    <sequence>
        <receive name="clientreceive" createInstance="yes" partnerLink="client" operation="travelWSDLOperation" xmlns:tns="http://j2ee.netbeans.org/wsdl/travelWSDL" portType="tns:travelWSDLPortType" variable="ClientInput"/>
        <assign name="Assign1">
            <copy>
                <from>$ClientInput.input/ns0:source</from>
                <to>$EAGetAvailabilityIn.parameters/source</to>
            </copy>
            <copy>
                <from>$ClientInput.input/ns0:destination</from>
                <to>$EAGetAvailabilityIn.parameters/destination</to>
            </copy>
            <copy>
                <from>$ClientInput.input/ns0:seats</from>
                <to>$EAGetAvailabilityIn.parameters/seats</to>
            </copy>
        </assign>
        <invoke name="EAAvailability" partnerLink="EastAirline" operation="getAvailability" xmlns:tns="http://ea/" portType="tns:EastAirlinesWS" inputVariable="EAGetAvailabilityIn" outputVariable="EAGetAvailabilityOut"/>
        <if name="If1">
            <condition>$EAGetAvailabilityOut.parameters/return = 'ok'</condition>
            <sequence name="Sequence1">
                <assign name="Assign2">
                    <copy>
                        <from>$ClientInput.input/ns0:name</from>
                        <to>$EABookIn.parameters/name</to>
                    </copy>
                    <copy>
                        <from>$ClientInput.input/ns0:source</from>
                        <to>$EABookIn.parameters/source</to>
                    </copy>
                    <copy>
                        <from>$ClientInput.input/ns0:destination</from>
                        <to>$EABookIn.parameters/destination</to>
                    </copy>
                    <copy>
                        <from>$ClientInput.input/ns0:seats</from>
                        <to>$EABookIn.parameters/seats</to>
                    </copy>
                </assign>
                <invoke name="EAbook" partnerLink="EastAirline" operation="book" xmlns:tns="http://ea/" portType="tns:EastAirlinesWS" inputVariable="EABookIn" outputVariable="EABookOut"/>
                <assign name="Assign3">
                    <copy>
                        <from>$EABookOut.parameters/return</from>
                        <to>$clientOutput.output/ns0:ticket</to>
                    </copy>
                </assign>
            </sequence>
            <else>
                <sequence name="Sequence2">
                    <assign name="Assign4">
                        <copy>
                            <from>$ClientInput.input/ns0:source</from>
                            <to>$WAGetAvailabilityIn.parameters/source</to>
                        </copy>
                        <copy>
                            <from>$ClientInput.input/ns0:destination</from>
                            <to>$WAGetAvailabilityIn.parameters/destination</to>
                        </copy>
                        <copy>
                            <from>$ClientInput.input/ns0:seats</from>
                            <to>$WAGetAvailabilityIn.parameters/seats</to>
                        </copy>
                    </assign>
                    <invoke name="WAAvailability" partnerLink="WestAirline" operation="getAvailability" xmlns:tns="http://wa/" portType="tns:WestAirlinesWS" inputVariable="WAGetAvailabilityIn" outputVariable="WAGetAvailabilityOut"/>
                    <if name="If2">
                        <condition>$WAGetAvailabilityOut.parameters/return = 'ok'</condition>
                        <sequence name="Sequence3">
                            <assign name="Assign5">
                                <copy>
                                    <from>$ClientInput.input/ns0:name</from>
                                    <to>$WABookIn.parameters/name</to>
                                </copy>
                                <copy>
                                    <from>$ClientInput.input/ns0:source</from>
                                    <to>$WABookIn.parameters/source</to>
                                </copy>
                                <copy>
                                    <from>$ClientInput.input/ns0:destination</from>
                                    <to>$WABookIn.parameters/destination</to>
                                </copy>
                                <copy>
                                    <from>$ClientInput.input/ns0:seats</from>
                                    <to>$WABookIn.parameters/seats</to>
                                </copy>
                            </assign>
                            <invoke name="WAbook" partnerLink="WestAirline" operation="book" xmlns:tns="http://wa/" portType="tns:WestAirlinesWS" inputVariable="WABookIn" outputVariable="WABookOut"/>
                            <assign name="Assign6">
                                <copy>
                                    <from>$WABookOut.parameters/return</from>
                                    <to>$clientOutput.output/ns0:ticket</to>
                                </copy>
                            </assign>
                        </sequence>
                        <else>
                            <assign name="Assign7">
                                <copy>
                                    <from>'no ticket'</from>
                                    <to>$clientOutput.output/ns0:ticket</to>
                                </copy>
                            </assign>
                        </else>
                    </if>
                </sequence>
            </else>
        </if>
        <reply name="clientReply" partnerLink="client" operation="travelWSDLOperation" xmlns:tns="http://j2ee.netbeans.org/wsdl/travelWSDL" portType="tns:travelWSDLPortType" variable="clientOutput"/>
    </sequence>
</process>
