blob: 690e7ed0b1c0ecc1cda86b645fd6ffbd56278d91 [file] [log] [blame]
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<bpws:process exitOnStandardFault="yes"
expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
name="QueryTest"
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
suppressJoinFailure="yes" targetNamespace="mynamespace"
xmlns:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:ode="http://www.apache.org/ode/type/extension"
xmlns:tns="mynamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<bpws:import importType="http://schemas.xmlsoap.org/wsdl/"
location="QueryTestArtifacts.wsdl" namespace="mynamespace"/>
<bpws:partnerLinks>
<bpws:partnerLink myRole="QueryTest1Provider" name="client" partnerLinkType="tns:QueryTest1"/>
</bpws:partnerLinks>
<bpws:variables>
<bpws:variable messageType="tns:QueryTest1RequestMessage" name="input"/>
<bpws:variable messageType="tns:QueryTest1ResponseMessage" name="output"/>
<bpws:variable element="tns:RecordSet" name="RecordSet"/>
<bpws:variable element="tns:Record" name="Record"/>
</bpws:variables>
<bpws:sequence name="QueryTest1">
<bpws:receive createInstance="yes" name="ReceiveInput"
operation="process" partnerLink="client"
portType="tns:QueryTest1" variable="input"/>
<bpws:assign name="InitializeRecordSetVariable" validate="no">
<bpws:copy>
<bpws:from>
<bpws:literal>
<tns:RecordSet xmlns:tns="mynamespace"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="mynamespace QueryTest1.wsdl ">
<tns:Record>
<tns:SomeValue>one</tns:SomeValue>
<tns:AnotherValue>ONE</tns:AnotherValue>
</tns:Record>
<tns:Record>
<tns:SomeValue>two</tns:SomeValue>
<tns:AnotherValue>TWO</tns:AnotherValue>
</tns:Record>
<tns:Record>
<tns:SomeValue>three</tns:SomeValue>
<tns:AnotherValue>THREE</tns:AnotherValue>
</tns:Record>
</tns:RecordSet>
</bpws:literal>
</bpws:from>
<bpws:to variable="RecordSet"/>
</bpws:copy>
</bpws:assign>
<bpws:assign name="InitializeRecordVariable" validate="no">
<bpws:copy>
<bpws:from>
<bpws:literal>
<tns:Record xmlns:tns="mynamespace"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="mynamespace QueryTest1.wsdl ">
<tns:SomeValue/>
<tns:AnotherValue/>
</tns:Record>
</bpws:literal>
</bpws:from>
<bpws:to variable="Record"/>
</bpws:copy>
</bpws:assign>
<bpws:assign name="AssignRequestedRecordToVariable" validate="no">
<bpws:copy>
<bpws:from variable="RecordSet">
<bpws:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"><![CDATA[tns:Record[number($input.payload)]/tns:SomeValue]]></bpws:query>
</bpws:from>
<bpws:to variable="Record">
<bpws:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"><![CDATA[tns:SomeValue]]></bpws:query>
</bpws:to>
<!-- <bpws:to expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"><![CDATA[$Record/tns:SomeValue]]></bpws:to> -->
</bpws:copy>
<bpws:copy>
<bpws:from variable="RecordSet">
<bpws:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"><![CDATA[tns:Record[number($input.payload)]/tns:AnotherValue]]></bpws:query>
</bpws:from>
<bpws:to variable="Record">
<bpws:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"><![CDATA[tns:AnotherValue]]></bpws:query>
</bpws:to>
<!-- <bpws:to expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"><![CDATA[$Record/tns:AnotherValue]]></bpws:to> -->
</bpws:copy>
</bpws:assign>
<bpws:assign name="AssignFromVariableToOutput" validate="no">
<bpws:copy>
<bpws:from variable="Record">
<bpws:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"><![CDATA[tns:SomeValue]]></bpws:query>
</bpws:from>
<bpws:to part="payload" variable="output"/>
</bpws:copy>
</bpws:assign>
<bpws:reply name="ReplyWithOutput" operation="process"
partnerLink="client" portType="tns:QueryTest1" variable="output"/>
</bpws:sequence>
</bpws:process>