Updated Branches:
refs/heads/master 08ab8a5ec -> b09ea8ad7
closing ODE-454, kudos to Shammy Chen for the detailed report.
Conflicts:
bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTest.java
Project: http://git-wip-us.apache.org/repos/asf/ode/repo
Commit: http://git-wip-us.apache.org/repos/asf/ode/commit/b7a70252
Tree: http://git-wip-us.apache.org/repos/asf/ode/tree/b7a70252
Diff: http://git-wip-us.apache.org/repos/asf/ode/diff/b7a70252
Branch: refs/heads/master
Commit: b7a70252b5604221c5f2d0f8d3c3be563393ace2
Parents: 08ab8a5
Author: Tammo van Lessen <[email protected]>
Authored: Tue Aug 27 18:47:55 2013 +0200
Committer: Tammo van Lessen <[email protected]>
Committed: Thu Aug 29 23:43:25 2013 +0200
----------------------------------------------------------------------
.../ode/bpel/compiler/ForEachGenerator.java | 4 +-
.../bpel/compiler/bom/BpelObjectFactory.java | 4 ++
.../apache/ode/bpel/compiler/bom/Branches.java | 44 ++++++++++++++++++++
.../bpel/compiler/bom/CompletionCondition.java | 4 ++
.../ode/bpel/compiler_2_0/GoodCompileTest.java | 3 ++
.../2.0/good/foreach/ForEach3-2.0.bpel | 2 +-
6 files changed, 58 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ode/blob/b7a70252/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ForEachGenerator.java
----------------------------------------------------------------------
diff --git
a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ForEachGenerator.java
b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ForEachGenerator.java
index d661940..d672899 100644
---
a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ForEachGenerator.java
+++
b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ForEachGenerator.java
@@ -58,8 +58,8 @@ public class ForEachGenerator extends
DefaultActivityGenerator {
oforEach.completionCondition =
new OForEach.CompletionCondition(_context.getOProcess());
oforEach.completionCondition.successfulBranchesOnly
- =
forEach.getCompletionCondition().isSuccessfulBranchesOnly();
- oforEach.completionCondition.branchCount =
_context.compileExpr(forEach.getCompletionCondition());
+ =
forEach.getCompletionCondition().getBranch().isSuccessfulBranchesOnly();
+ oforEach.completionCondition.branchCount =
_context.compileExpr(forEach.getCompletionCondition().getBranch());
}
// ForEach 'adds' a counter variable in inner scope
http://git-wip-us.apache.org/repos/asf/ode/blob/b7a70252/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObjectFactory.java
----------------------------------------------------------------------
diff --git
a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObjectFactory.java
b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObjectFactory.java
index 7b81744..02cde22 100644
---
a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObjectFactory.java
+++
b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObjectFactory.java
@@ -79,6 +79,8 @@ public class BpelObjectFactory {
_mappings.put(Bpel20QNames.FINAL_PICK, PickActivity.class);
_mappings.put(Bpel20QNames.FINAL_SCOPE, ScopeActivity.class);
_mappings.put(Bpel20QNames.FINAL_FOREACH, ForEachActivity.class);
+ _mappings.put(Bpel20QNames.FINAL_COMPLETION_CONDITION,
CompletionCondition.class);
+ _mappings.put(Bpel20QNames.FINAL_BRANCHES, Branches.class);
_mappings.put(Bpel20QNames.FINAL_COPY, Copy.class);
_mappings.put(Bpel20QNames.FINAL_CATCH, Catch.class);
_mappings.put(Bpel20QNames.FINAL_CATCHALL, Catch.class);
@@ -160,6 +162,8 @@ public class BpelObjectFactory {
_mappings.put(Bpel20QNames.FROM, From.class);
_mappings.put(Bpel20QNames.START_COUNTER_VALUE, Expression.class);
_mappings.put(Bpel20QNames.FINAL_COUNTER_VALUE, Expression.class);
+ _mappings.put(Bpel20QNames.COMPLETION_CONDITION,
CompletionCondition.class);
+ _mappings.put(Bpel20QNames.BRANCHES, Branches.class);
_mappings.put(Bpel20QNames.CORRELATION, Correlation.class);
_mappings.put(Bpel20QNames.CORRELATIONSET, CorrelationSet.class);
_mappings.put(Bpel20QNames.COMPENSATE, CompensateScopeActivity.class);
http://git-wip-us.apache.org/repos/asf/ode/blob/b7a70252/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Branches.java
----------------------------------------------------------------------
diff --git
a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Branches.java
b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Branches.java
new file mode 100644
index 0000000..7e175ad
--- /dev/null
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Branches.java
@@ -0,0 +1,44 @@
+/*
+ * 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;
+
+/**
+ * Interface for a <code><branches></code> as used in a
+ * forEach activity.
+ */
+public class Branches extends Expression {
+
+ public Branches(Element el) {
+ super(el);
+ }
+
+ /**
+ * Gets whether the completion count should include all terminated children
+ * or only successfully completed ones.
+ *
+ * @return counts completed
+ */
+ public boolean isSuccessfulBranchesOnly() {
+ return getAttribute("successfulBranchesOnly", "no").equals("yes");
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/ode/blob/b7a70252/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompletionCondition.java
----------------------------------------------------------------------
diff --git
a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompletionCondition.java
b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompletionCondition.java
index 48b01ab..7ba96ea 100644
---
a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompletionCondition.java
+++
b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompletionCondition.java
@@ -40,4 +40,8 @@ public class CompletionCondition extends Expression {
public boolean isSuccessfulBranchesOnly() {
return getAttribute("successfulBranchesOnly", "no").equals("yes");
}
+
+ public Branches getBranch() {
+ return (Branches) getFirstChild(Branches.class);
+ }
}
http://git-wip-us.apache.org/repos/asf/ode/blob/b7a70252/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTest.java
----------------------------------------------------------------------
diff --git
a/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTest.java
b/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTest.java
index 2e7f31f..8dd49b1 100644
---
a/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTest.java
+++
b/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTest.java
@@ -27,6 +27,9 @@ import org.apache.ode.bpel.compiler.api.CompileListener;
import org.junit.Assert;
import org.junit.Test;
+ suite.addTest(new
GoodCompileTCase("/2.0/good/foreach/ForEach1-2.0.bpel"));
+ suite.addTest(new
GoodCompileTCase("/2.0/good/foreach/ForEach2-2.0.bpel"));
+ suite.addTest(new
GoodCompileTCase("/2.0/good/foreach/ForEach3-2.0.bpel"));
public class GoodCompileTest extends AbstractCompileTestCase implements
CompileListener {
http://git-wip-us.apache.org/repos/asf/ode/blob/b7a70252/bpel-scripts/src/main/resources/2.0/good/foreach/ForEach3-2.0.bpel
----------------------------------------------------------------------
diff --git a/bpel-scripts/src/main/resources/2.0/good/foreach/ForEach3-2.0.bpel
b/bpel-scripts/src/main/resources/2.0/good/foreach/ForEach3-2.0.bpel
index 2ff63d5..4f84b46 100644
--- a/bpel-scripts/src/main/resources/2.0/good/foreach/ForEach3-2.0.bpel
+++ b/bpel-scripts/src/main/resources/2.0/good/foreach/ForEach3-2.0.bpel
@@ -50,7 +50,7 @@
<startCounterValue>0</startCounterValue>
<finalCounterValue>10</finalCounterValue>
<completionCondition>
- <branches>5</branches>
+ <branches successfulBranchesOnly="yes">5</branches>
</completionCondition>
<scope name="sc1">