Author: mriou
Date: Fri May 11 11:30:37 2007
New Revision: 537260

URL: http://svn.apache.org/viewvc?view=rev&rev=537260
Log:
The compiler should allow no input var if the operation input has no part.

Modified:
    
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/InvokeGenerator.java

Modified: 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/InvokeGenerator.java
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/InvokeGenerator.java?view=diff&rev=537260&r1=537259&r2=537260
==============================================================================
--- 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/InvokeGenerator.java
 (original)
+++ 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/InvokeGenerator.java
 Fri May 11 11:30:37 2007
@@ -19,10 +19,6 @@
 
 package org.apache.ode.bpel.compiler;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
 import org.apache.ode.bpel.compiler.api.CompilationException;
 import org.apache.ode.bpel.compiler.bom.Activity;
 import org.apache.ode.bpel.compiler.bom.Correlation;
@@ -35,6 +31,10 @@
 import org.apache.ode.utils.stl.CollectionsX;
 import org.apache.ode.utils.stl.MemberOfFunction;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
 /**
  * Generates code for <code>&lt;invoke&gt;</code> activities.
  */
@@ -63,10 +63,13 @@
         // throw new CompilationException(CMSGSG.errPortTypeMismatch(portType,
         // onMessage.partnerLink.myRolePortType.getQName()));
         if (oinvoke.operation.getInput() != null && 
oinvoke.operation.getInput().getMessage() != null) {
-            if (src.getInputVar() == null)
-                throw new 
CompilationException(__imsgs.errInvokeNoInputMessageForInputOp(oinvoke.operation.getName()));
-            oinvoke.inputVar = 
_context.resolveMessageVariable(src.getInputVar(), oinvoke.operation.getInput()
-                    .getMessage().getQName());
+            // Input var can be omitted if input message has no part 
+            if (oinvoke.operation.getInput().getMessage().getParts().size() > 
0) {
+                if (src.getInputVar() == null)
+                    throw new 
CompilationException(__imsgs.errInvokeNoInputMessageForInputOp(oinvoke.operation.getName()));
+                oinvoke.inputVar = 
_context.resolveMessageVariable(src.getInputVar(), oinvoke.operation.getInput()
+                        .getMessage().getQName());
+            }
         }
         if (oinvoke.operation.getOutput() != null && 
oinvoke.operation.getOutput().getMessage() != null) {
             if (src.getOutputVar() == null)


Reply via email to