Author: karthick
Date: Wed Apr 15 23:49:53 2009
New Revision: 765432
URL: http://svn.apache.org/viewvc?rev=765432&view=rev
Log:
ODE-581 Problem with query expressions when assigning from variable to variable
Added:
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestToQuery/
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestToQuery/QueryTest1.bpel
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestToQuery/QueryTest1.wsdl
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestToQuery/deploy.xml
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestToQuery/test.properties
Modified:
ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java
Modified:
ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java?rev=765432&r1=765431&r2=765432&view=diff
==============================================================================
---
ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java
(original)
+++
ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java
Wed Apr 15 23:49:53 2009
@@ -234,16 +234,14 @@
vref.variable = _context.resolveVariable(vv.getVariable());
if (to.getAsVariableVal().getPart() != null) {
vref.part = _context.resolvePart(vref.variable,
vv.getPart());
- if (vv.getLocation() != null &&
vv.getLocation().getExpression() != null)
- vref.location = _context.compileExpr(vv.getLocation());
}
if (to.getAsVariableVal().getHeader() != null) {
vref.headerPart =
_context.resolveHeaderPart(vref.variable, vv.getHeader());
if (vref.headerPart == null)
vref.headerPart = new
OMessageVarType.Part(_context.getOProcess(), to.getAsVariableVal().getHeader(),
null);
- if (vv.getLocation() != null &&
vv.getLocation().getExpression() != null)
- vref.location = _context.compileExpr(vv.getLocation());
}
+ if (vv.getLocation() != null &&
vv.getLocation().getExpression() != null)
+ vref.location = _context.compileExpr(vv.getLocation());
return vref;
} else if (to.isPartnerLinkVal()) {
OAssign.PartnerLinkRef plref = new
OAssign.PartnerLinkRef(_context.getOProcess());
Modified:
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java?rev=765432&r1=765431&r2=765432&view=diff
==============================================================================
---
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java
(original)
+++
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java
Wed Apr 15 23:49:53 2009
@@ -47,6 +47,11 @@
}
@Test
+ public void testToQuery() throws Throwable {
+ go("/bpel/2.0/TestToQuery");
+ }
+
+ @Test
public void testSubTreeAssign() throws Throwable {
go("/bpel/2.0/TestSubTreeAssign");
}
Added:
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestToQuery/QueryTest1.bpel
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestToQuery/QueryTest1.bpel?rev=765432&view=auto
==============================================================================
---
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestToQuery/QueryTest1.bpel
(added)
+++
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestToQuery/QueryTest1.bpel
Wed Apr 15 23:49:53 2009
@@ -0,0 +1,103 @@
+<bpws:process exitOnStandardFault="yes"
+ expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
+ name="QueryTest1"
+ 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="QueryTest1.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>
\ No newline at end of file
Added:
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestToQuery/QueryTest1.wsdl
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestToQuery/QueryTest1.wsdl?rev=765432&view=auto
==============================================================================
---
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestToQuery/QueryTest1.wsdl
(added)
+++
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestToQuery/QueryTest1.wsdl
Wed Apr 15 23:49:53 2009
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<definitions name="QueryTest1"
+ targetNamespace="mynamespace"
+ xmlns:tns="mynamespace"
+ xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ >
+
+ <types>
+ <schema attributeFormDefault="unqualified"
elementFormDefault="qualified"
+ targetNamespace="mynamespace"
+ xmlns="http://www.w3.org/2001/XMLSchema">
+
+ <element name="QueryTest1Request" type="int" />
+ <element name="QueryTest1Response" type="string" />
+
+ <complexType name="RecordType">
+ <sequence>
+ <element name="SomeValue" type="string"></element>
+ <element name="AnotherValue" type="string"></element>
+ </sequence>
+ </complexType>
+
+ <complexType name="RecordSetType">
+ <sequence>
+ <element ref="tns:Record" minOccurs="0"
maxOccurs="unbounded"></element>
+ </sequence>
+ </complexType>
+
+ <element name="Record" type="tns:RecordType"></element>
+ <element name="RecordSet" type="tns:RecordSetType"></element>
+ </schema>
+ </types>
+
+ <message name="QueryTest1RequestMessage">
+ <part name="payload" element="tns:QueryTest1Request"/>
+ </message>
+ <message name="QueryTest1ResponseMessage">
+ <part name="payload" element="tns:QueryTest1Response"/>
+ </message>
+
+ <portType name="QueryTest1">
+ <operation name="process">
+ <input message="tns:QueryTest1RequestMessage" />
+ <output message="tns:QueryTest1ResponseMessage"/>
+ </operation>
+ </portType>
+
+ <plnk:partnerLinkType name="QueryTest1">
+ <plnk:role name="QueryTest1Provider" portType="tns:QueryTest1"/>
+ </plnk:partnerLinkType>
+
+ <binding name="QueryTest1Binding" type="tns:QueryTest1">
+ <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
+ <operation name="process">
+ <soap:operation soapAction="mynamespace/process" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+
+ <service name="QueryTest1Service">
+ <port name="QueryTest1Port" binding="tns:QueryTest1Binding">
+ <soap:address location="http://localhost:8888/ode/QueryTest1" />
+ </port>
+ </service>
+</definitions>
Added:
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestToQuery/deploy.xml
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestToQuery/deploy.xml?rev=765432&view=auto
==============================================================================
---
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestToQuery/deploy.xml
(added)
+++
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestToQuery/deploy.xml
Wed Apr 15 23:49:53 2009
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
xmlns:ns1="mynamespace">
+ <process name="ns1:QueryTest1">
+ <active>true</active>
+ <provide partnerLink="client">
+ <service name="ns1:QueryTest1Service" port="QueryTest1Port"/>
+ </provide>
+ </process>
+</deploy>
Added:
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestToQuery/test.properties
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestToQuery/test.properties?rev=765432&view=auto
==============================================================================
---
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestToQuery/test.properties
(added)
+++
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestToQuery/test.properties
Wed Apr 15 23:49:53 2009
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+namespace=mynamespace
+service=QueryTest1Service
+operation=process
+request1=<message><payload><QueryTest1Request
xmlns="mynamespace">1</QueryTest1Request></payload></message>
+response1=.*one.*
\ No newline at end of file