ode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mr...@apache.org
Subject svn commit: r548815 - in /incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler: AssignGenerator.java bom/ToFrom.java bom/VariableVal.java bom/VariableVal11.java
Date Tue, 19 Jun 2007 18:28:46 GMT
Author: mriou
Date: Tue Jun 19 11:28:46 2007
New Revision: 548815

URL: http://svn.apache.org/viewvc?view=rev&rev=548815
Log:
Fixed assignments of the form variable/part with an additional query attribute or sub-element
(depending on the spec version).

Modified:
    incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java
    incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ToFrom.java
    incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/VariableVal.java
    incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/VariableVal11.java

Modified: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java?view=diff&rev=548815&r1=548814&r2=548815
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java
(original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java
Tue Jun 19 11:28:46 2007
@@ -31,12 +31,11 @@
 import org.apache.ode.bpel.compiler.bom.PropertyVal;
 import org.apache.ode.bpel.compiler.bom.To;
 import org.apache.ode.bpel.compiler.bom.VariableVal;
-import org.apache.ode.bpel.compiler.bom.VariableVal11;
 import org.apache.ode.bpel.o.DebugInfo;
 import org.apache.ode.bpel.o.OActivity;
 import org.apache.ode.bpel.o.OAssign;
-import org.apache.ode.bpel.o.OMessageVarType;
 import org.apache.ode.bpel.o.OAssign.RValue;
+import org.apache.ode.bpel.o.OMessageVarType;
 import org.apache.ode.utils.DOMUtils;
 import org.apache.ode.utils.msg.MessageBundle;
 import org.w3c.dom.Document;
@@ -167,10 +166,8 @@
                 vref.variable = _context.resolveVariable(vv.getVariable());
                 if (vv.getPart() != null) {
                     vref.part = _context.resolvePart(vref.variable, vv.getPart());
-                    // The following only applies to BPEL 1.1 processes:
-                    if (vv instanceof VariableVal11)
-                        if (((VariableVal11)vv).getLocation() != null)
-                            vref.location = _context.compileExpr(((VariableVal11)vv).getLocation());
+                    if (vv.getLocation() != null)
+                        vref.location = _context.compileExpr(vv.getLocation());
                 }
                 // TODO: check for irrelevant properties.
                 return vref;
@@ -230,10 +227,8 @@
                 vref.variable = _context.resolveVariable(vv.getVariable());
                 if (to.getAsVariableVal().getPart() != null) {
                     vref.part = _context.resolvePart(vref.variable, vv.getPart());
-                    // Following applies only to BPEL 1.1
-                    if (vv instanceof VariableVal11)
-                        if (((VariableVal11)vv).getLocation() != null)
-                        vref.location = _context.compileExpr(((VariableVal11)vv).getLocation());
+                    if (vv.getLocation() != null)
+                        vref.location = _context.compileExpr(vv.getLocation());
                 }
                 // TODO: check for irrelevant properties.
                 return vref;

Modified: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ToFrom.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ToFrom.java?view=diff&rev=548815&r1=548814&r2=548815
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ToFrom.java
(original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ToFrom.java
Tue Jun 19 11:28:46 2007
@@ -27,9 +27,10 @@
     }
     
     public VariableVal getAsVariableVal() {
-        if (getAttribute("variable", null) != null)
-            return new VariableVal(getElement());
-        // TODO fix for 11
+        if (getAttribute("variable", null) != null) {
+            if (is11()) return new VariableVal11(getElement());
+            else return new VariableVal(getElement());
+        }
         return null;
     }
     

Modified: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/VariableVal.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/VariableVal.java?view=diff&rev=548815&r1=548814&r2=548815
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/VariableVal.java
(original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/VariableVal.java
Tue Jun 19 11:28:46 2007
@@ -46,4 +46,8 @@
         return getAttribute("part", null);
     }
 
+    public Expression getLocation() {
+        return getFirstChild(Query.class);
+    }
+
 }

Modified: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/VariableVal11.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/VariableVal11.java?view=diff&rev=548815&r1=548814&r2=548815
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/VariableVal11.java
(original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/VariableVal11.java
Tue Jun 19 11:28:46 2007
@@ -27,8 +27,8 @@
     }
 
     public Expression getLocation() {
-        return (getAttribute("location") != null) 
-                ? new Expression11(getElement(), getElement().getAttributeNode("location"))
+        return (getAttribute("query") != null)
+                ? new Expression11(getElement(), getElement().getAttributeNode("query"))
                 : null;
     }
 



Mime
View raw message