Author: mszefler
Date: Thu May 17 07:37:53 2007
New Revision: 538946

URL: http://svn.apache.org/viewvc?view=rev&rev=538946
Log:
Added the BPEL 2.0 final compensateScope activity.

Added:
    
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CompensateScopeGenerator.java
   (with props)
    
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompensateScopeActivity.java
   (with props)
Modified:
    
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler11.java
    
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler20.java
    
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler20Draft.java
    
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CompensateGenerator.java
    
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObjectFactory.java
    
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompensateActivity.java

Modified: 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler11.java
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler11.java?view=diff&rev=538946&r1=538945&r2=538946
==============================================================================
--- 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler11.java
 (original)
+++ 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler11.java
 Thu May 17 07:37:53 2007
@@ -20,7 +20,7 @@
 
 import org.apache.ode.bpel.compiler.bom.AssignActivity;
 import org.apache.ode.bpel.compiler.bom.Bpel11QNames;
-import org.apache.ode.bpel.compiler.bom.CompensateActivity;
+import org.apache.ode.bpel.compiler.bom.CompensateScopeActivity;
 import org.apache.ode.bpel.compiler.bom.EmptyActivity;
 import org.apache.ode.bpel.compiler.bom.FlowActivity;
 import org.apache.ode.bpel.compiler.bom.InvokeActivity;
@@ -48,7 +48,7 @@
         super((WSDLFactory4BPEL) WSDLFactoryBPEL11.newInstance());
 
         registerActivityCompiler(EmptyActivity.class, new EmptyGenerator());
-        registerActivityCompiler(CompensateActivity.class, new 
CompensateGenerator());
+        registerActivityCompiler(CompensateScopeActivity.class, new 
CompensateGenerator());
         registerActivityCompiler(FlowActivity.class, new FlowGenerator());
         registerActivityCompiler(SequenceActivity.class, new 
SequenceGenerator());
         registerActivityCompiler(AssignActivity.class, new AssignGenerator());

Modified: 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler20.java
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler20.java?view=diff&rev=538946&r1=538945&r2=538946
==============================================================================
--- 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler20.java
 (original)
+++ 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler20.java
 Thu May 17 07:37:53 2007
@@ -21,6 +21,7 @@
 import org.apache.ode.bpel.compiler.bom.AssignActivity;
 import org.apache.ode.bpel.compiler.bom.Bpel20QNames;
 import org.apache.ode.bpel.compiler.bom.CompensateActivity;
+import org.apache.ode.bpel.compiler.bom.CompensateScopeActivity;
 import org.apache.ode.bpel.compiler.bom.EmptyActivity;
 import org.apache.ode.bpel.compiler.bom.FlowActivity;
 import org.apache.ode.bpel.compiler.bom.ForEachActivity;
@@ -52,6 +53,7 @@
         super((WSDLFactory4BPEL) WSDLFactoryBPEL20.newInstance());
 
         registerActivityCompiler(EmptyActivity.class, new EmptyGenerator());
+        registerActivityCompiler(CompensateScopeActivity.class, new 
CompensateScopeGenerator());
         registerActivityCompiler(CompensateActivity.class, new 
CompensateGenerator());
         registerActivityCompiler(FlowActivity.class, new FlowGenerator());
         registerActivityCompiler(SequenceActivity.class, new 
SequenceGenerator());

Modified: 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler20Draft.java
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler20Draft.java?view=diff&rev=538946&r1=538945&r2=538946
==============================================================================
--- 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler20Draft.java
 (original)
+++ 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler20Draft.java
 Thu May 17 07:37:53 2007
@@ -21,7 +21,7 @@
 
 import org.apache.ode.bpel.compiler.bom.AssignActivity;
 import org.apache.ode.bpel.compiler.bom.Bpel20QNames;
-import org.apache.ode.bpel.compiler.bom.CompensateActivity;
+import org.apache.ode.bpel.compiler.bom.CompensateScopeActivity;
 import org.apache.ode.bpel.compiler.bom.EmptyActivity;
 import org.apache.ode.bpel.compiler.bom.FlowActivity;
 import org.apache.ode.bpel.compiler.bom.ForEachActivity;
@@ -53,7 +53,7 @@
         super((WSDLFactory4BPEL) WSDLFactoryBPEL20Draft.newInstance());
 
         registerActivityCompiler(EmptyActivity.class, new EmptyGenerator());
-        registerActivityCompiler(CompensateActivity.class, new 
CompensateGenerator());
+        registerActivityCompiler(CompensateScopeActivity.class, new 
CompensateGenerator());
         registerActivityCompiler(FlowActivity.class, new FlowGenerator());
         registerActivityCompiler(SequenceActivity.class, new 
SequenceGenerator());
         registerActivityCompiler(AssignActivity.class, new AssignGenerator());

Modified: 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CompensateGenerator.java
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CompensateGenerator.java?view=diff&rev=538946&r1=538945&r2=538946
==============================================================================
--- 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CompensateGenerator.java
 (original)
+++ 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CompensateGenerator.java
 Thu May 17 07:37:53 2007
@@ -18,25 +18,17 @@
  */
 package org.apache.ode.bpel.compiler;
 
-import org.apache.ode.bpel.compiler.api.CompilationException;
 import org.apache.ode.bpel.compiler.bom.Activity;
-import org.apache.ode.bpel.compiler.bom.CompensateActivity;
 import org.apache.ode.bpel.o.OActivity;
 import org.apache.ode.bpel.o.OCompensate;
-import org.apache.ode.utils.msg.MessageBundle;
 
 
 /**
  * Generates code for the <code>&lt;compensate&gt;</code> activities.
  */
 class CompensateGenerator extends DefaultActivityGenerator {
-    private static final CompensateGeneratorMessages __cmsgs = 
MessageBundle.getMessages(CompensateGeneratorMessages.class);
     
     public void compile(OActivity output, Activity src) {
-        CompensateActivity compSrc = (CompensateActivity) src;
-        if (compSrc.getScopeToCompensate() == null)
-            throw new 
CompilationException(__cmsgs.errScopeToCompensateUnspecfied());
-        ((OCompensate)output).compensatedScope = 
_context.resolveCompensatableScope(compSrc.getScopeToCompensate());
     }
 
     public OActivity newInstance(Activity src) {

Added: 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CompensateScopeGenerator.java
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CompensateScopeGenerator.java?view=auto&rev=538946
==============================================================================
--- 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CompensateScopeGenerator.java
 (added)
+++ 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CompensateScopeGenerator.java
 Thu May 17 07:37:53 2007
@@ -0,0 +1,28 @@
+package org.apache.ode.bpel.compiler;
+
+import org.apache.ode.bpel.compiler.api.CompilationException;
+import org.apache.ode.bpel.compiler.bom.Activity;
+import org.apache.ode.bpel.compiler.bom.CompensateScopeActivity;
+import org.apache.ode.bpel.o.OActivity;
+import org.apache.ode.bpel.o.OCompensate;
+import org.apache.ode.utils.msg.MessageBundle;
+
+
+/**
+ * Generates code for the <code>&lt;compensateScope&gt;</code> activities.
+ */
+class CompensateScopeGenerator extends DefaultActivityGenerator {
+    private static final CompensateGeneratorMessages __cmsgs = 
MessageBundle.getMessages(CompensateGeneratorMessages.class);
+    
+    public void compile(OActivity output, Activity src) {
+        CompensateScopeActivity compSrc = (CompensateScopeActivity) src;
+        if (compSrc.getScopeToCompensate() == null)
+            throw new 
CompilationException(__cmsgs.errScopeToCompensateUnspecfied());
+        ((OCompensate)output).compensatedScope = 
_context.resolveCompensatableScope(compSrc.getScopeToCompensate());
+    }
+
+    public OActivity newInstance(Activity src) {
+        return new OCompensate(_context.getOProcess(), _context.getCurrent());
+    }
+}
+

Propchange: 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CompensateScopeGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObjectFactory.java
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObjectFactory.java?view=diff&rev=538946&r1=538945&r2=538946
==============================================================================
--- 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObjectFactory.java
 (original)
+++ 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObjectFactory.java
 Thu May 17 07:37:53 2007
@@ -62,7 +62,7 @@
         _mappings.put(Bpel20QNames.FINAL_WAIT, WaitActivity.class);
         _mappings.put(Bpel20QNames.FINAL_THROW, ThrowActivity.class);
         _mappings.put(Bpel20QNames.FINAL_COMPENSATE, CompensateActivity.class);
-        _mappings.put(Bpel20QNames.FINAL_COMPENSATE_SCOPE, 
CompensateActivity.class);
+        _mappings.put(Bpel20QNames.FINAL_COMPENSATE_SCOPE, 
CompensateScopeActivity.class);
         _mappings.put(Bpel20QNames.FINAL_RETHROW, RethrowActivity.class);
         _mappings.put(Bpel20QNames.FINAL_EXIT, TerminateActivity.class);
         _mappings.put(Bpel20QNames.FINAL_FLOW, FlowActivity.class);
@@ -84,6 +84,7 @@
         _mappings.put(Bpel20QNames.FINAL_CORRELATION, Correlation.class);
         _mappings.put(Bpel20QNames.FINAL_CORRELATIONSET, CorrelationSet.class);
         _mappings.put(Bpel20QNames.FINAL_COMPENSATE, CompensateActivity.class);
+        _mappings.put(Bpel20QNames.FINAL_COMPENSATE_SCOPE, 
CompensateScopeActivity.class);
         _mappings.put(Bpel20QNames.FINAL_COMPENSATIONHANDLER, 
CompensationHandler.class);
         _mappings.put(Bpel20QNames.FINAL_FAULTHANDLERS, FaultHandler.class);
         _mappings.put(Bpel20QNames.FINAL_TERMINATIONHANDLER, 
TerminationHandler.class);
@@ -135,7 +136,7 @@
         _mappings.put(Bpel20QNames.REPLY, ReplyActivity.class);
         _mappings.put(Bpel20QNames.WAIT, WaitActivity.class);
         _mappings.put(Bpel20QNames.THROW, ThrowActivity.class);
-        _mappings.put(Bpel20QNames.COMPENSATE, CompensateActivity.class);
+        _mappings.put(Bpel20QNames.COMPENSATE, CompensateScopeActivity.class);
         _mappings.put(Bpel20QNames.RETHROW, RethrowActivity.class);
         _mappings.put(Bpel20QNames.EXIT, TerminateActivity.class);
         _mappings.put(Bpel20QNames.FLOW, FlowActivity.class);
@@ -156,7 +157,7 @@
         _mappings.put(Bpel20QNames.FINAL_COUNTER_VALUE, Expression.class);
         _mappings.put(Bpel20QNames.CORRELATION, Correlation.class);
         _mappings.put(Bpel20QNames.CORRELATIONSET, CorrelationSet.class);
-        _mappings.put(Bpel20QNames.COMPENSATE, CompensateActivity.class);
+        _mappings.put(Bpel20QNames.COMPENSATE, CompensateScopeActivity.class);
         _mappings.put(Bpel20QNames.COMPENSATIONHANDLER, 
CompensationHandler.class);
         _mappings.put(Bpel20QNames.FAULTHANDLERS, FaultHandler.class);
         _mappings.put(Bpel20QNames.TERMINATIONHANDLER, 
TerminationHandler.class);
@@ -208,7 +209,6 @@
         _mappings.put(Bpel11QNames.REPLY, ReplyActivity.class);
         _mappings.put(Bpel11QNames.WAIT, WaitActivity.class);
         _mappings.put(Bpel11QNames.THROW, ThrowActivity.class);
-        _mappings.put(Bpel11QNames.COMPENSATE, CompensateActivity.class);
         _mappings.put(Bpel11QNames.TERMINATE, TerminateActivity.class);
         _mappings.put(Bpel11QNames.FLOW, FlowActivity.class);
         _mappings.put(Bpel11QNames.SWITCH, SwitchActivity.class);
@@ -223,7 +223,7 @@
         _mappings.put(Bpel11QNames.FROM, From.class);
         _mappings.put(Bpel11QNames.CORRELATION, Correlation.class);
         _mappings.put(Bpel11QNames.CORRELATIONSET, CorrelationSet.class);
-        _mappings.put(Bpel11QNames.COMPENSATE, CompensateActivity.class);
+        _mappings.put(Bpel11QNames.COMPENSATE, CompensateScopeActivity.class);
         _mappings.put(Bpel11QNames.COMPENSATIONHANDLER, 
CompensationHandler.class);
         _mappings.put(Bpel11QNames.FAULTHANDLERS, FaultHandler.class);
         _mappings.put(Bpel11QNames.CASE, SwitchActivity.Case.class);

Modified: 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompensateActivity.java
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompensateActivity.java?view=diff&rev=538946&r1=538945&r2=538946
==============================================================================
--- 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompensateActivity.java
 (original)
+++ 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompensateActivity.java
 Thu May 17 07:37:53 2007
@@ -28,15 +28,5 @@
     public CompensateActivity(Element el) {
         super(el);
     }
-
-    /**
-     * Get the name of the compensate scope: the scope which is compensated by
-     * this activity.
-     * 
-     * @return scope compensated by this activity
-     */
-    public String getScopeToCompensate() {
-        return getAttribute("target", getAttribute("scope", null));
-    }
-
 }
+

Added: 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompensateScopeActivity.java
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompensateScopeActivity.java?view=auto&rev=538946
==============================================================================
--- 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompensateScopeActivity.java
 (added)
+++ 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompensateScopeActivity.java
 Thu May 17 07:37:53 2007
@@ -0,0 +1,42 @@
+/*
+ * 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.bpel.compiler.bom;
+
+import org.w3c.dom.Element;
+
+/**
+ * Representation of the BPEL <code>&lt;compensateScope&gt;</code> activity.
+ */
+public class CompensateScopeActivity extends Activity {
+
+    public CompensateScopeActivity(Element el) {
+        super(el);
+    }
+
+    /**
+     * Get the name of the compensate scope: the scope which is compensated by
+     * this activity.
+     * 
+     * @return scope compensated by this activity
+     */
+    public String getScopeToCompensate() {
+        return getAttribute("target", /** historical **/ getAttribute("scope", 
null));
+    }
+
+}

Propchange: 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompensateScopeActivity.java
------------------------------------------------------------------------------
    svn:eol-style = native


Reply via email to