<?xml version="1.0" encoding="UTF-8"?>
<bpws:process name="producerConsumer"
    targetNamespace="http://orchestra.ow2.org/demos/producerConsumer"
    xmlns:bpelj="http://schemas.xmlsoap.org/ws/2003/03/business-process/java"
    xmlns:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:tns="http://orchestra.ow2.org/demos/producerConsumer">
    <bpws:import importType="http://schemas.xmlsoap.org/wsdl/"
        location="consumerProducer.wsdl" namespace="http://orchestra.ow2.org/demos/producerConsumer"/>
    <bpws:partnerLinks>
        <bpws:partnerLink myRole="client" name="client" partnerLinkType="tns:clientPLT"/>
        <bpws:partnerLink myRole="producer" name="producer" partnerLinkType="tns:producerPLT"/>
    </bpws:partnerLinks>
    <bpws:variables>
        <bpws:variable messageType="tns:consumerRequest" name="clientInput"/>
        <bpws:variable messageType="tns:consumerResponse" name="clientOutput"/>
        <bpws:variable messageType="tns:producerMsg" name="producerMessage"/>
    </bpws:variables>
    <bpws:sequence name="Sequence">
        <bpws:flow name="Flow">
            <bpws:receive createInstance="yes" name="ProducerReceive"
                operation="produce" partnerLink="producer"
                portType="tns:producerPT" variable="producerMessage"/>
            <bpws:receive createInstance="yes" name="ConsumerReceive"
                operation="request" partnerLink="client"
                portType="tns:consumerPT" variable="clientInput"/>
        </bpws:flow>
        <bpws:assign name="AssignReply" validate="no">
            <bpws:copy>
                <bpws:from><![CDATA[concat($clientInput.input, " received ", $producerMessage.product)]]></bpws:from>
                <bpws:to part="result" variable="clientOutput">
                    <bpws:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[tns:result]]></bpws:query>
                </bpws:to>
            </bpws:copy>
        </bpws:assign>
        <bpws:reply name="ConsumerReply" operation="request"
            partnerLink="client" portType="tns:consumerPT" variable="clientOutput"/>
    </bpws:sequence>
</bpws:process>
