<!-- HelloWorld BPEL Process [Generated by the Eclipse BPEL Designer] -->
<bpel:process name="SayHello"
         targetNamespace="http://www.jboss.org/bpel/examples"
         suppressJoinFailure="yes"
         xmlns:tns="http://www.jboss.org/bpel/examples"
         xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
         >

    <!-- Import the client WSDL -->
	<bpel:import location="SayHelloArtifacts.wsdl" namespace="http://www.jboss.org/bpel/examples" 
	        importType="http://schemas.xmlsoap.org/wsdl/" />
         
    <!-- ================================================================= -->         
    <!-- PARTNERLINKS                                                      -->
    <!-- List of services participating in this BPEL process               -->
    <!-- ================================================================= -->         
    <bpel:partnerLinks>
        <!-- The 'client' role represents the requester of this service. -->
        <bpel:partnerLink name="client"
                     partnerLinkType="tns:SayHello"
                     myRole="SayHelloProvider"
                     />
    </bpel:partnerLinks>
  
    <!-- ================================================================= -->         
    <!-- VARIABLES                                                         -->
    <!-- List of messages and XML documents used within this BPEL process  -->
    <!-- ================================================================= -->         
    <bpel:variables>
        <!-- Reference to the message passed as input during initiation -->
        <bpel:variable name="ReceiveSayHelloVar"
                  messageType="tns:SayHelloRequestMessage"/>
                  
        <!-- 
          Reference to the message that will be returned to the requester
          -->
        <bpel:variable name="ReplySayHelloVar"
                  messageType="tns:SayHelloResponseMessage"/>
    </bpel:variables>

    <!-- ================================================================= -->         
    <!-- ORCHESTRATION LOGIC                                               -->
    <!-- Set of activities coordinating the flow of messages across the    -->
    <!-- services integrated within this business process                  -->
    <!-- ================================================================= -->         
    <bpel:sequence name="main">
        
        <!-- Receive input from requester. 
             Note: This maps to operation defined in HelloWorld.wsdl 
             -->
        <bpel:receive name="ReceiveSayHello" partnerLink="client"
                 portType="tns:SayHello"
                 operation="sayHello" variable="ReceiveSayHelloVar"
                 createInstance="yes"/>
        
        <!-- Generate reply to synchronous request -->
        <bpel:assign validate="no" name="AssignName">
            <bpel:copy>
                <bpel:from><bpel:literal><tns:HelloWorldResponse xmlns:tns="http://www.jboss.org/bpel/examples" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <tns:result></tns:result>
</tns:HelloWorldResponse>
</bpel:literal></bpel:from>
                <bpel:to variable="ReplySayHelloVar" part="parameters"></bpel:to>
            </bpel:copy>
            <bpel:copy>
                <bpel:from>
                    <![CDATA[concat('Hello ', $ReceiveSayHelloVar.parameters/tns:input)]]>
                </bpel:from>
                <bpel:to part="parameters" variable="ReplySayHelloVar">
                    <bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[tns:result]]></bpel:query>
                </bpel:to>
            </bpel:copy>
        </bpel:assign>
        <bpel:reply name="ReplySayHello" 
               partnerLink="client"
               portType="tns:SayHello"
               operation="sayHello" 
               variable="ReplySayHelloVar"
               />
    </bpel:sequence>
</bpel:process>