<!--
  ///////////////////////////////////////////////////////////////////////////////////////////// 
  // Oracle JDeveloper BPEL Designer 
  // 
  // Created: Sat Jul 18 12:48:22 CST 2009
  // Author:  Administrator
  // Purpose: Asynchronous BPEL Process
  ///////////////////////////////////////////////////////////////////////////////////////////// 
-->
<process name="whu_wps_chain" targetNamespace="http://xmlns.oracle.com/whu_wps_chain" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:ns1="http://ws.lmars.whu.edu.cn/wps" xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:client="http://xmlns.oracle.com/whu_wps_chain" xmlns:bpelx="http://schemas.oracle.com/bpel/extension" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"><!-- ================================================================= --><!-- PARTNERLINKS                                                      --><!-- List of services participating in this BPEL process               --><!-- ================================================================= -->
  <partnerLinks><!-- 
    The 'client' role represents the requester of this service. It is 
    used for callback. The location and correlation information associated
    with the client role are automatically set using WS-Addressing.
    -->
    <partnerLink name="client" partnerLinkType="client:whu_wps_chain" myRole="whu_wps_chainProvider" partnerRole="whu_wps_chainRequester"/>
    <partnerLink name="WHU-WPS-SOAP" partnerRole="WPSPortType_Role" partnerLinkType="ns1:WPSPortType_PL"/>
  </partnerLinks><!-- ================================================================= --><!-- VARIABLES                                                         --><!-- List of messages and XML documents used within this BPEL process  --><!-- ================================================================= -->
  <variables><!-- Reference to the message passed as input during initiation -->
    <variable name="inputVariable" messageType="client:whu_wps_chainRequestMessage"/><!-- Reference to the message that will be sent back to the 
    requester during callback
    -->
    <variable name="outputVariable" messageType="client:whu_wps_chainResponseMessage"/>
    <variable name="Invoke_Buffer_1_execute_InputVariable" messageType="ns1:executeInputMsg"/>
    <variable name="Invoke_Buffer_1_execute_OutputVariable" messageType="ns1:executeOutputMsg"/>
    <variable name="Invoke_Buffer_2_execute_InputVariable" messageType="ns1:executeInputMsg"/>
    <variable name="Invoke_Buffer_2_execute_OutputVariable" messageType="ns1:executeOutputMsg"/>
    <variable name="Invoke_Overlay_execute_InputVariable" messageType="ns1:executeInputMsg"/>
    <variable name="Invoke_Overlay_execute_OutputVariable" messageType="ns1:executeOutputMsg"/>
  </variables><!-- ================================================================= --><!-- ORCHESTRATION LOGIC                                               --><!-- Set of activities coordinating the flow of messages across the    --><!-- services integrated within this business process                  --><!-- ================================================================= -->
  <sequence name="main"><!-- Receive input from requestor. 
    Note: This maps to operation defined in whu_wps_chain.wsdl
    -->
    <receive name="receiveInput" partnerLink="client" portType="client:whu_wps_chain" operation="initiate" variable="inputVariable" createInstance="yes"/><!-- Asynchronous callback to the requester.
     Note: the callback location and correlation id is transparently handled 
     using WS-addressing.
     -->
    <flow name="Flow_1">
      <sequence name="Sequence_2">
        <assign name="Assign_BufferData_2">
          <copy>
            <from expression="concat(string('&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;  &lt;Execute xmlns=&quot;http://www.opengeospatial.net/wps&quot; xmlns:ows=&quot;http://www.opengeospatial.net/ows&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; service=&quot;WPS&quot; status=&quot;false&quot; store=&quot;false&quot; version=&quot;0.4.0&quot;&gt;  &lt;ows:Identifier&gt;GeoBufferProcess&lt;/ows:Identifier&gt;  &lt;DataInputs&gt; &lt;Input&gt;  &lt;ows:Identifier&gt;InputData&lt;/ows:Identifier&gt;   &lt;ows:Title&gt;Vector data to be buffered&lt;/ows:Title&gt;  &lt;ComplexValue schema=&quot;http://www.lmars.whu.edu.cn/ws/iodata.xsd&quot;&gt; &lt;ComplexDataValue xmlns=&quot;http://www.lmars.whu.edu.cn/ws&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; xmlns:gml=&quot;http://www.opengis.net/gml&quot; xmlns:ows=&quot;http://www.opengis.net/ows&quot;&gt; &lt;Reference xlink:href=&quot;'),bpws:getVariableData('inputVariable','payload','/client:whu_wps_chainProcessRequest/client:buffer2_data'),string('&quot;&gt;  &lt;ows:Format&gt;ESRI Shapefile&lt;/ows:Format&gt;   &lt;/Reference&gt;  &lt;/ComplexDataValue&gt;  &lt;/ComplexValue&gt;  &lt;/Input&gt; &lt;Input&gt;  &lt;ows:Identifier&gt;Width&lt;/ows:Identifier&gt;   &lt;ows:Title&gt;Buffer Distance&lt;/ows:Title&gt;   &lt;LiteralValue dataType=&quot;xs:double&quot;&gt;'),bpws:getVariableData('inputVariable','payload','/client:whu_wps_chainProcessRequest/client:buffer2_distance'),string('&lt;/LiteralValue&gt;   &lt;/Input&gt;  &lt;/DataInputs&gt; &lt;OutputDefinitions&gt; &lt;Output&gt;  &lt;ows:Identifier&gt;OutputData&lt;/ows:Identifier&gt;   &lt;/Output&gt;  &lt;/OutputDefinitions&gt;  &lt;/Execute&gt;'))"/>
            <to variable="Invoke_Buffer_2_execute_InputVariable" part="payload" query="/ns1:execute"/>
          </copy>
        </assign>
        <invoke name="Invoke_Buffer_2" partnerLink="WHU-WPS-SOAP" portType="ns1:WPSPortType" operation="execute" inputVariable="Invoke_Buffer_2_execute_InputVariable" outputVariable="Invoke_Buffer_2_execute_OutputVariable"/>
      </sequence>
      <sequence name="Sequence_1">
        <assign name="Assign_BufferData_1">
          <copy>
            <from expression="concat(string('&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;  &lt;Execute xmlns=&quot;http://www.opengeospatial.net/wps&quot; xmlns:ows=&quot;http://www.opengeospatial.net/ows&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; service=&quot;WPS&quot; status=&quot;false&quot; store=&quot;false&quot; version=&quot;0.4.0&quot;&gt;  &lt;ows:Identifier&gt;GeoBufferProcess&lt;/ows:Identifier&gt;  &lt;DataInputs&gt; &lt;Input&gt;  &lt;ows:Identifier&gt;InputData&lt;/ows:Identifier&gt;   &lt;ows:Title&gt;Vector data to be buffered&lt;/ows:Title&gt;  &lt;ComplexValue schema=&quot;http://www.lmars.whu.edu.cn/ws/iodata.xsd&quot;&gt; &lt;ComplexDataValue xmlns=&quot;http://www.lmars.whu.edu.cn/ws&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; xmlns:gml=&quot;http://www.opengis.net/gml&quot; xmlns:ows=&quot;http://www.opengis.net/ows&quot;&gt; &lt;Reference xlink:href=&quot;'),bpws:getVariableData('inputVariable','payload','/client:whu_wps_chainProcessRequest/client:buffer1_data'),string('&quot;&gt;  &lt;ows:Format&gt;ESRI Shapefile&lt;/ows:Format&gt;   &lt;/Reference&gt;  &lt;/ComplexDataValue&gt;  &lt;/ComplexValue&gt;  &lt;/Input&gt; &lt;Input&gt;  &lt;ows:Identifier&gt;Width&lt;/ows:Identifier&gt;   &lt;ows:Title&gt;Buffer Distance&lt;/ows:Title&gt;   &lt;LiteralValue dataType=&quot;xs:double&quot;&gt;'),bpws:getVariableData('inputVariable','payload','/client:whu_wps_chainProcessRequest/client:buffer1_distance'),string('&lt;/LiteralValue&gt;   &lt;/Input&gt;  &lt;/DataInputs&gt; &lt;OutputDefinitions&gt; &lt;Output&gt;  &lt;ows:Identifier&gt;OutputData&lt;/ows:Identifier&gt;   &lt;/Output&gt;  &lt;/OutputDefinitions&gt;  &lt;/Execute&gt;'))"/>
            <to variable="Invoke_Buffer_1_execute_InputVariable" part="payload" query="/ns1:execute"/>
          </copy>
        </assign>
        <invoke name="Invoke_Buffer_1" partnerLink="WHU-WPS-SOAP" portType="ns1:WPSPortType" operation="execute" inputVariable="Invoke_Buffer_1_execute_InputVariable" outputVariable="Invoke_Buffer_1_execute_OutputVariable"/>
      </sequence>
    </flow>
    <assign name="Assign_BufferResult">
      <copy>
        <from expression="substring-before(substring-after(   substring-after(bpws:getVariableData('Invoke_Buffer_1_execute_OutputVariable','payload','/ns1:executeResponse') , 'ProcessOutputs') , 'href=&quot;' ) , '&quot;' )  "/>
        <to variable="Invoke_Buffer_1_execute_OutputVariable" part="payload" query="/ns1:executeResponse"/>
      </copy>
      <copy>
        <from expression="substring-before(substring-after(   substring-after(bpws:getVariableData('Invoke_Buffer_2_execute_OutputVariable','payload','/ns1:executeResponse'), 'ProcessOutputs') , 'href=&quot;' ) , '&quot;' )  "/>
        <to variable="Invoke_Buffer_2_execute_OutputVariable" part="payload" query="/ns1:executeResponse"/>
      </copy>
    </assign>
    <assign name="Assign_OverlayInput">
      <copy>
        <from expression="concat(string('&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt; &lt;Execute xmlns=&quot;http://www.opengeospatial.net/wps&quot; xmlns:ows=&quot;http://www.opengeospatial.net/ows&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; service=&quot;WPS&quot; status=&quot;false&quot; store=&quot;false&quot; version=&quot;0.4.0&quot;&gt;  &lt;ows:Identifier&gt;GeoOverlayProcess&lt;/ows:Identifier&gt;  &lt;DataInputs&gt; &lt;Input&gt;  &lt;ows:Identifier&gt;FirstInputData&lt;/ows:Identifier&gt;   &lt;ows:Title&gt;FirstInputData&lt;/ows:Title&gt;  &lt;ComplexValue schema=&quot;http://www.lmars.whu.edu.cn/ws/iodata.xsd&quot;&gt; &lt;ComplexDataValue xmlns=&quot;http://www.lmars.whu.edu.cn/ws&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; xmlns:gml=&quot;http://www.opengis.net/gml&quot; xmlns:ows=&quot;http://www.opengis.net/ows&quot;&gt; &lt;Reference xlink:href=&quot;'),bpws:getVariableData('Invoke_Buffer_1_execute_OutputVariable','payload','/ns1:executeResponse'),string('&quot;&gt;  &lt;ows:Format&gt;ESRI Shapefile&lt;/ows:Format&gt;   &lt;/Reference&gt;  &lt;/ComplexDataValue&gt;  &lt;/ComplexValue&gt;  &lt;/Input&gt; &lt;Input&gt;  &lt;ows:Identifier&gt;SecondInputData&lt;/ows:Identifier&gt;   &lt;ows:Title&gt;SecondInputData&lt;/ows:Title&gt;  &lt;ComplexValue schema=&quot;http://www.lmars.whu.edu.cn/ws/iodata.xsd&quot;&gt; &lt;ComplexDataValue xmlns=&quot;http://www.lmars.whu.edu.cn/ws&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; xmlns:gml=&quot;http://www.opengis.net/gml&quot; xmlns:ows=&quot;http://www.opengis.net/ows&quot;&gt; &lt;Reference xlink:href=&quot;'),bpws:getVariableData('Invoke_Buffer_2_execute_OutputVariable','payload','/ns1:executeResponse'),string('&quot;&gt;  &lt;ows:Format&gt;ESRI Shapefile&lt;/ows:Format&gt;   &lt;/Reference&gt;  &lt;/ComplexDataValue&gt;  &lt;/ComplexValue&gt;  &lt;/Input&gt; &lt;Input&gt;  &lt;ows:Identifier&gt;Operator&lt;/ows:Identifier&gt;   &lt;ows:Title&gt;Overlay Operator&lt;/ows:Title&gt;   &lt;LiteralValue dataType=&quot;xs:string&quot;&gt;and&lt;/LiteralValue&gt;   &lt;/Input&gt;  &lt;/DataInputs&gt; &lt;OutputDefinitions&gt; &lt;Output&gt;  &lt;ows:Identifier&gt;OutputData&lt;/ows:Identifier&gt;   &lt;/Output&gt;  &lt;/OutputDefinitions&gt;  &lt;/Execute&gt;'))"/>
        <to variable="Invoke_Overlay_execute_InputVariable" part="payload" query="/ns1:execute"/>
      </copy>
    </assign>
    <invoke name="Invoke_Overlay" partnerLink="WHU-WPS-SOAP" portType="ns1:WPSPortType" operation="execute" inputVariable="Invoke_Overlay_execute_InputVariable" outputVariable="Invoke_Overlay_execute_OutputVariable"/>
    <assign name="Assign_OverlayOutput">
      <copy>
        <from variable="Invoke_Overlay_execute_OutputVariable" part="payload" query="/ns1:executeResponse"/>
        <to variable="outputVariable" part="payload" query="/client:whu_wps_chainProcessResponse/client:result"/>
      </copy>
    </assign>
    <invoke name="callbackClient" partnerLink="client" portType="client:whu_wps_chainCallback" operation="onResult" inputVariable="outputVariable"/>
  </sequence>
</process>