Author: midon
Date: Tue Jul  8 16:05:29 2008
New Revision: 675027

URL: http://svn.apache.org/viewvc?rev=675027&view=rev
Log:
do not return too early when a message has no part. we meay need headers

Modified:
    
ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
    
ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ScopeFrame.java

Modified: 
ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
URL: 
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java?rev=675027&r1=675026&r2=675027&view=diff
==============================================================================
--- 
ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
 (original)
+++ 
ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
 Tue Jul  8 16:05:29 2008
@@ -485,7 +485,7 @@
        public Node readVariable(Long scopeInstanceId, String varname, boolean 
forWriting) throws FaultException {
                ScopeDAO scopedao = _dao.getScope(scopeInstanceId);
                XmlDataDAO var = scopedao.getVariable(varname);
-               return var.isNull() ? null : var.get();
+               return (var == null || var.isNull()) ? null : var.get();
        }
        
     public Node writeVariable(VariableInstance variable, Node changes) {

Modified: 
ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ScopeFrame.java
URL: 
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ScopeFrame.java?rev=675027&r1=675026&r2=675027&view=diff
==============================================================================
--- 
ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ScopeFrame.java
 (original)
+++ 
ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ScopeFrame.java
 Tue Jul  8 16:05:29 2008
@@ -162,17 +162,6 @@
     Node fetchVariableData(BpelRuntimeContext brc, VariableInstance variable, 
boolean forWriting)
             throws FaultException
     {
-        // Special case of messageType variables with no part
-        if (variable.declaration.type instanceof OMessageVarType) {
-            OMessageVarType msgType = (OMessageVarType) 
variable.declaration.type;
-            if (msgType.parts.size() == 0) {
-                Document doc = DOMUtils.newDocument();
-                Element root = doc.createElement("message");
-                doc.appendChild(root);
-                return root;
-            }
-        }
-
         if (variable.declaration.extVar != null) {
             // Note, that when using external variables, the database will not 
contain the value of the
             // variable, instead we need to go the external variable 
subsystems.
@@ -197,6 +186,16 @@
         } else /* not external */ {
             Node data = 
brc.readVariable(variable.scopeInstance,variable.declaration.name, forWriting);
             if (data == null) {
+                // Special case of messageType variables with no part
+                if (variable.declaration.type instanceof OMessageVarType) {
+                    OMessageVarType msgType = (OMessageVarType) 
variable.declaration.type;
+                    if (msgType.parts.size() == 0) {
+                        Document doc = DOMUtils.newDocument();
+                        Element root = doc.createElement("message");
+                        doc.appendChild(root);
+                        return root;
+                    }
+                }
                 throw new 
FaultException(oscope.getOwner().constants.qnUninitializedVariable,
                         "The variable " + variable.declaration.name + " isn't 
properly initialized.");
             }


Reply via email to