ode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From karth...@apache.org
Subject svn commit: r785015 - in /ode/branches/APACHE_ODE_1.X: bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xquery10/runtime/ bpel-test/src/test/java/org/apache/ode/test/ bpel-test/src/test/resources/bpel/2.0/TestXQueryExpression/
Date Mon, 15 Jun 2009 22:52:17 GMT
Author: karthick
Date: Mon Jun 15 22:52:16 2009
New Revision: 785015

URL: http://svn.apache.org/viewvc?rev=785015&view=rev
Log:
ODE-623 Using boolean global variable inside xquery doesn't work

Modified:
    ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xquery10/runtime/XQuery10ExpressionRuntime.java
    ode/branches/APACHE_ODE_1.X/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java
    ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestXQueryExpression/HelloXQueryWorld.bpel

Modified: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xquery10/runtime/XQuery10ExpressionRuntime.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xquery10/runtime/XQuery10ExpressionRuntime.java?rev=785015&r1=785014&r2=785015&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xquery10/runtime/XQuery10ExpressionRuntime.java
(original)
+++ ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xquery10/runtime/XQuery10ExpressionRuntime.java
Mon Jun 15 22:52:16 2009
@@ -18,6 +18,9 @@
  */
 package org.apache.ode.bpel.elang.xquery10.runtime;
 
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.net.URI;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Collections;
@@ -527,6 +530,26 @@
             xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_LONG);
         } else if (value instanceof String) {
             xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_STRING);
+        } else if (value instanceof Boolean) {
+        	xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_BOOLEAN);
+        } else if (value instanceof Date) {
+        	xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_DATETIME);
+        } else if (value instanceof BigDecimal) {
+        	xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_DECIMAL);
+        } else if (value instanceof Float) {
+        	xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_FLOAT);
+        } else if (value instanceof URI) {
+        	xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_ANYURI);
+        } else if (value instanceof QName) {
+        	xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_QNAME);
+        } else if (value instanceof BigInteger) {
+        	xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_INT);
+        } else if (value instanceof Integer) {
+        	xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_INTEGER);
+        } else if (value instanceof Double) {
+        	xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_DOUBLE);
+        } else if (value instanceof Byte) {
+        	xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_BYTE);
         } else if (value instanceof Node) {
         	xqType = xqconn.createNodeType();
         } else if (value instanceof NodeList || value instanceof XQSequence) {

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=785015&r1=785014&r2=785015&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
Mon Jun 15 22:52:16 2009
@@ -118,8 +118,7 @@
 
     @Test
     public void testXQueryExpression() throws Throwable {
-        deploy("/bpel/2.0/TestXQueryExpression");
-        go();
+        go("/bpel/2.0/TestXQueryExpression");
     }
 
     @Test

Modified: ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestXQueryExpression/HelloXQueryWorld.bpel
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestXQueryExpression/HelloXQueryWorld.bpel?rev=785015&r1=785014&r2=785015&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestXQueryExpression/HelloXQueryWorld.bpel
(original)
+++ ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestXQueryExpression/HelloXQueryWorld.bpel
Mon Jun 15 22:52:16 2009
@@ -43,6 +43,9 @@
         <variable name="myVar" messageType="test:HelloXQueryMessage"/>
         <variable name="otherVar" type="xsd:string"/>
         <variable name="tempVar" element="test:content"/>
+        <variable name="stringVar" type="xsd:string"/>
+        <variable name="boolVar" type="xsd:boolean"/>
+        <variable name="i" type="xsd:int"/>
     </variables>
             
     <sequence>   
@@ -121,6 +124,76 @@
            <condition>not($tempVar/wsa:EndpointReference/wsa:Metadata/Service/@EndpointName
eq "MyEndpoint")</condition>
            <throw faultName="selectionFailure"/>
         </if>
+        <assign>
+            <copy>
+                <from>0</from>
+                <to variable="i"/>
+            </copy>
+        </assign>
+        <while>
+            <condition>$i &lt; 2</condition>
+            <sequence>
+                <if>
+                    <condition>$i = 0</condition>
+                    <assign>
+                        <copy>
+                            <from>"false"</from>
+                            <to variable="stringVar"/>
+                        </copy>
+                        <copy>
+                            <from>false()</from>
+                            <to variable="boolVar"/>
+                        </copy>
+                    </assign>
+                    <else>
+                        <assign>
+                            <copy>
+                                <from>"true"</from>
+                                <to variable="stringVar"/>
+                            </copy>
+                            <copy>
+                                <from>true()</from>
+                                <to variable="boolVar"/>
+                            </copy>
+                        </assign>
+                    </else>
+                </if>
+				<!--
+                <assign>
+                    <copy>
+                        <from expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xquery1.0">
+        						if (boolean($stringVar)) then "trueValue" else "falseValue"
+        				</from>
+                        <to variable="otherVar"/>
+                    </copy>
+                </assign>
+	           <if>
+                    <condition>not($otherVar = concat($stringVar, "Value"))</condition>
+                    <throw faultName="selectionFailure"/>
+                </if>
+    			-->
+     
+          	    <assign>
+                    <copy>
+                        <from expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xquery1.0">
+        						if ($boolVar) then "trueValue" else "falseValue"
+        				</from>
+                        <to variable="otherVar"/>
+                    </copy>
+                </assign>
+                <if>
+                    <condition>not($otherVar = concat($stringVar, "Value"))</condition>
+                    <throw faultName="selectionFailure"/>
+                </if>
+    
+                <assign>
+                    <copy>
+                        <from>$i + 1</from>
+                        <to variable="i"/>
+                    </copy>
+                </assign>
+            </sequence>
+        </while>
         <scope>
             <faultHandlers>
                 <catch faultName="subLanguageExecutionFault">



Mime
View raw message