Author: mriou
Date: Fri Apr 13 07:21:54 2007
New Revision: 528493

URL: http://svn.apache.org/viewvc?view=rev&rev=528493
Log:
Bug fix in complex typed variables assignment and one more test case that goes 
with it. As a general rule of thumb the doc.createElement method should *never* 
be used in ODE as we use ns elements extensively and such a node will produce a 
null local name. Instead use doc.createElementNS(null, "foo").

Added:
    incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/
    
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/Assignment.xsd
    
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/ComplexVariables-Variable.bpel
    
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/ComplexVariables-Variable.deploy
    
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/ComplexVariables-Variable.wsdl
    
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/ComplexVariables.wsdl
    
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/deploy.xml
    
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/test.properties
Modified:
    
incubator/ode/trunk/bpel-obj/src/main/java/org/apache/ode/bpel/o/OXsdTypeVarType.java
    
incubator/ode/trunk/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java

Modified: 
incubator/ode/trunk/bpel-obj/src/main/java/org/apache/ode/bpel/o/OXsdTypeVarType.java
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-obj/src/main/java/org/apache/ode/bpel/o/OXsdTypeVarType.java?view=diff&rev=528493&r1=528492&r2=528493
==============================================================================
--- 
incubator/ode/trunk/bpel-obj/src/main/java/org/apache/ode/bpel/o/OXsdTypeVarType.java
 (original)
+++ 
incubator/ode/trunk/bpel-obj/src/main/java/org/apache/ode/bpel/o/OXsdTypeVarType.java
 Fri Apr 13 07:21:54 2007
@@ -18,11 +18,11 @@
  */
 package org.apache.ode.bpel.o;
 
-import javax.xml.namespace.QName;
-
 import org.w3c.dom.Document;
-import org.w3c.dom.Node;
 import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import javax.xml.namespace.QName;
 
 /**
  * XSD-typed variable type.
@@ -42,7 +42,7 @@
         if (simple)
             return doc.createTextNode("");
         else {
-            Element el = doc.createElement("xsd-complex-type-wrapper");
+            Element el = doc.createElementNS(null, "xsd-complex-type-wrapper");
             return el;
         }
     }

Modified: 
incubator/ode/trunk/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java?view=diff&rev=528493&r1=528492&r2=528493
==============================================================================
--- 
incubator/ode/trunk/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java
 (original)
+++ 
incubator/ode/trunk/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java
 Fri Apr 13 07:21:54 2007
@@ -1,21 +1,21 @@
-/*
- * 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.
- */
+/*
+ * 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.
+ */
 package org.apache.ode.test;
 
 public class DataHandling20Test extends BPELTestAbstract {
@@ -34,6 +34,9 @@
     }
     public void testAssignActivity2() throws Throwable {
         go("src/test/resources/bpel/2.0/TestAssignActivity2");
+    }
+    public void testAssignComplex() throws Throwable {
+        go("src/test/resources/bpel/2.0/TestAssignComplex");
     }
     public void testSimpleTypeParts() throws Throwable {
        go("target/test-classes/bpel/2.0/TestSimpleTypeParts");

Added: 
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/Assignment.xsd
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/Assignment.xsd?view=auto&rev=528493
==============================================================================
--- 
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/Assignment.xsd
 (added)
+++ 
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/Assignment.xsd
 Fri Apr 13 07:21:54 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema"; 
targetNamespace="http://www.example.org/Assignment"; 
xmlns:tns="http://www.example.org/Assignment"; elementFormDefault="qualified">
+
+    <complexType name="AssignTask">
+       <sequence>
+               <element name="Name" type="string"></element>
+               <element name="JobProfile" type="string"></element>
+               <element name="Status" type="string"></element>
+       </sequence>
+    </complexType>
+</schema>
\ No newline at end of file

Added: 
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/ComplexVariables-Variable.bpel
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/ComplexVariables-Variable.bpel?view=auto&rev=528493
==============================================================================
--- 
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/ComplexVariables-Variable.bpel
 (added)
+++ 
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/ComplexVariables-Variable.bpel
 Fri Apr 13 07:21:54 2007
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<bpel:process 
xmlns:bpel="http://schemas.xmlsoap.org/ws/2004/03/business-process/"; 
xmlns:pnlk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:Client="http://example.com/ComplexVariables/Client"; 
xmlns:this="http://example.com/ComplexVariables/Variable"; 
xmlns:diag="http://example.com/ComplexVariables"; 
xmlns:tns="http://www.example.org/Assignment"; 
xmlns:bpmn="http://www.intalio.com/bpms"; 
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0" 
expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0" 
bpmn:label="Variable" bpmn:id="_UkazoOjtEdujRdw0-l3_qw" name="Variable" 
targetNamespace="http://example.com/ComplexVariables/Variable";>
+  <bpel:import namespace="http://example.com/ComplexVariables"; 
location="ComplexVariables.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
+  <bpel:import namespace="http://example.com/ComplexVariables/Variable"; 
location="ComplexVariables-Variable.wsdl" 
importType="http://schemas.xmlsoap.org/wsdl/"/>
+  <bpel:import namespace="http://www.example.org/Assignment"; 
location="Assignment.xsd" 
importType="http://www.w3.org/2001/XMLSchema";></bpel:import>
+  <bpel:partnerLinks>
+    <bpel:partnerLink name="clientAndVariablePlkVar" 
partnerLinkType="diag:ClientAndVariablePlk" myRole="Variable_for_Client"/>
+  </bpel:partnerLinks>
+  <bpel:variables>
+    <bpel:variable name="thisReceiveRequestMsg" 
messageType="this:receiveRequest"/>
+    <bpel:variable name="thisReceiveResponseMsg" 
messageType="this:receiveResponse"/>
+    <bpel:variable name="complex" type="tns:AssignTask"/>
+  </bpel:variables>
+  <bpel:sequence>
+    <bpel:receive partnerLink="clientAndVariablePlkVar" 
portType="this:ForClient" operation="receive" variable="thisReceiveRequestMsg" 
createInstance="yes" bpmn:label="receive" 
bpmn:id="_VkMOkOjtEdujRdw0-l3_qw"></bpel:receive>
+    <bpel:assign name="init-variables-Variable">
+      <bpel:copy>
+        <bpel:from>
+          <bpel:literal><this:receiveResponse/>
+          </bpel:literal>
+        </bpel:from>
+        <bpel:to>$thisReceiveResponseMsg.body</bpel:to>
+      </bpel:copy>
+    </bpel:assign>
+    <bpel:assign bpmn:label="assignComplex" bpmn:id="_o1W14OjwEdujRdw0-l3_qw">
+      <bpel:copy>
+        <bpel:from>$thisReceiveRequestMsg.body</bpel:from>
+        <bpel:to>$complex</bpel:to>
+      </bpel:copy>
+    </bpel:assign>
+    <bpel:assign bpmn:label="result" bpmn:id="_NSMGsOjuEdujRdw0-l3_qw">
+      <bpel:copy>
+        <bpel:from>$complex</bpel:from>
+        <bpel:to>$thisReceiveResponseMsg.body</bpel:to>
+      </bpel:copy>
+    </bpel:assign>
+    <bpel:reply partnerLink="clientAndVariablePlkVar" 
portType="this:ForClient" operation="receive" variable="thisReceiveResponseMsg" 
bpmn:label="result" bpmn:id="_NSMGsOjuEdujRdw0-l3_qw"></bpel:reply>
+  </bpel:sequence>
+</bpel:process>
\ No newline at end of file

Added: 
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/ComplexVariables-Variable.deploy
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/ComplexVariables-Variable.deploy?view=auto&rev=528493
==============================================================================
--- 
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/ComplexVariables-Variable.deploy
 (added)
+++ 
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/ComplexVariables-Variable.deploy
 Fri Apr 13 07:21:54 2007
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<dd:process xmlns:dd="http://ode.fivesight.com/schemas/2006/06/27/dd"; 
xmlns:tns="http://www.example.org/Assignment"; 
xmlns:Client="http://example.com/ComplexVariables/Client"; 
xmlns:diag="http://example.com/ComplexVariables"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:this="http://example.com/ComplexVariables/Variable"; name="this:Variable" 
fileName="ComplexVariables-Variable.bpel">
+  <dd:property name="PATH">TestComplexVariable/ComplexVariables</dd:property>
+  <dd:provide partnerLink="clientAndVariablePlkVar">
+    <dd:service name="this:CanonicServiceForClient" port="canonicPort"/>
+  </dd:provide>
+</dd:process>
\ No newline at end of file

Added: 
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/ComplexVariables-Variable.wsdl
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/ComplexVariables-Variable.wsdl?view=auto&rev=528493
==============================================================================
--- 
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/ComplexVariables-Variable.wsdl
 (added)
+++ 
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/ComplexVariables-Variable.wsdl
 Fri Apr 13 07:21:54 2007
@@ -0,0 +1,39 @@
+<?xml version='1.0' encoding='utf-8'?>
+<wsdl:definitions xmlns:tns="http://www.example.org/Assignment"; 
xmlns:Client="http://example.com/ComplexVariables/Client"; 
xmlns:diag="http://example.com/ComplexVariables"; 
xmlns:pnlk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:this="http://example.com/ComplexVariables/Variable"; 
targetNamespace="http://example.com/ComplexVariables/Variable";>
+    <wsdl:types>
+        <xs:schema elementFormDefault="qualified" 
targetNamespace="http://example.com/ComplexVariables/Variable";>
+            <xs:import namespace="http://www.example.org/Assignment"; 
schemaLocation="Assignment.xsd"/>
+            <xs:element name="receiveRequest" type="tns:AssignTask"/>
+            <xs:element name="receiveResponse" type="tns:AssignTask"/>
+        </xs:schema>
+    </wsdl:types>
+    <wsdl:message name="receiveRequest">
+        <wsdl:part name="body" element="this:receiveRequest"/>
+    </wsdl:message>
+    <wsdl:message name="receiveResponse">
+        <wsdl:part name="body" element="this:receiveResponse"/>
+    </wsdl:message>
+    <wsdl:portType name="ForClient">
+        <wsdl:operation name="receive">
+            <wsdl:input message="this:receiveRequest" name="receive"/>
+            <wsdl:output message="this:receiveResponse" 
name="receiveResponse"/>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="CanonicBindingForClient" type="this:ForClient">
+        <soap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="receive">
+            <soap:operation style="document" 
soapAction="http://example.com/ComplexVariables/Variable/ForClient/receive"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="CanonicServiceForClient">
+        <wsdl:port name="canonicPort" binding="this:CanonicBindingForClient">
+            <soap:address 
location="http://localhost:8080/ode/processes/TestComplexVariable/ComplexVariables/ForClient"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file

Added: 
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/ComplexVariables.wsdl
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/ComplexVariables.wsdl?view=auto&rev=528493
==============================================================================
--- 
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/ComplexVariables.wsdl
 (added)
+++ 
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/ComplexVariables.wsdl
 Fri Apr 13 07:21:54 2007
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<wsdl:definitions xmlns:tns="http://www.example.org/Assignment"; 
xmlns:bpdm="http://www.intalio/designer/business-process-data-modeling"; 
xmlns:Client="http://example.com/ComplexVariables/Client"; 
xmlns:diag="http://example.com/ComplexVariables"; 
xmlns:Variable="http://example.com/ComplexVariables/Variable"; 
xmlns:pnlk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
targetNamespace="http://example.com/ComplexVariables";>
+    <wsdl:import namespace="http://example.com/ComplexVariables/Variable"; 
location="ComplexVariables-Variable.wsdl"/>
+    <pnlk:partnerLinkType name="ClientAndVariablePlk">
+        <pnlk:role name="Variable_for_Client" portType="Variable:ForClient"/>
+    </pnlk:partnerLinkType>
+</wsdl:definitions>
\ No newline at end of file

Added: 
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/deploy.xml
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/deploy.xml?view=auto&rev=528493
==============================================================================
--- 
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/deploy.xml
 (added)
+++ 
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/deploy.xml
 Fri Apr 13 07:21:54 2007
@@ -0,0 +1,6 @@
+<?xml version='1.0' encoding='UTF-8'?><dd:deploy 
xmlns:dd="http://ode.fivesight.com/schemas/2006/06/27/dd";><dd:process 
xmlns:dd="http://ode.fivesight.com/schemas/2006/06/27/dd"; 
xmlns:tns="http://www.example.org/Assignment"; 
xmlns:Client="http://example.com/ComplexVariables/Client"; 
xmlns:diag="http://example.com/ComplexVariables"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:this="http://example.com/ComplexVariables/Variable"; name="this:Variable" 
fileName="ComplexVariables-Variable.bpel">
+  <dd:property name="PATH">TestComplexVariable/ComplexVariables</dd:property>
+  <dd:provide partnerLink="clientAndVariablePlkVar">
+    <dd:service name="this:CanonicServiceForClient" port="canonicPort" />
+  </dd:provide>
+</dd:process></dd:deploy>
\ No newline at end of file

Added: 
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/test.properties
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/test.properties?view=auto&rev=528493
==============================================================================
--- 
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/test.properties
 (added)
+++ 
incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/test.properties
 Fri Apr 13 07:21:54 2007
@@ -0,0 +1,5 @@
+namespace=http://example.com/ComplexVariables/Variable
+service=CanonicServiceForClient
+operation=receive
+request1=<message><body><ns1:receiveRequest 
xmlns:ns1="http://example.com/ComplexVariables/Variable";><ns1:Name>name</ns1:Name><ns1:JobProfile>profile</ns1:JobProfile><ns1:Status>status</ns1:Status></ns1:receiveRequest></body></message>
+response1=.*receiveResponse.*name.*profile.*status.*
\ No newline at end of file


Reply via email to