, P extends RuleFlowNodeContainerFactory> implements MappableNodeFactory {
-
+ public static final String METHOD_CONSTRAINT = "constraint";
public static final String METHOD_NAME = "name";
public static final String METHOD_METADATA = "metaData";
public static final String METHOD_DONE = "done";
@@ -71,4 +75,20 @@ public Mappable getMappableNode() {
return (Mappable) node;
}
+ public T constraint(WorkflowElementIdentifier toNodeId, String name, String type, String dialect, ReturnValueEvaluator evaluator, int priority) {
+ return constraint(toNodeId, name, type, dialect, evaluator, priority, false);
+ }
+
+ public T constraint(WorkflowElementIdentifier toNodeId, String name, String type, String dialect, ReturnValueEvaluator evaluator, int priority, boolean isDefault) {
+ ReturnValueConstraintEvaluator constraintImpl = new ReturnValueConstraintEvaluator();
+ constraintImpl.setName(name);
+ constraintImpl.setType(type);
+ constraintImpl.setDialect(dialect);
+ constraintImpl.setPriority(priority);
+ constraintImpl.setEvaluator(evaluator);
+ constraintImpl.setConstraint("expression already given as evaluator");
+ constraintImpl.setDefault(isDefault);
+ ((NodeImpl) node).addConstraint(new ConnectionRef(name, toNodeId, Node.CONNECTION_DEFAULT_TYPE), constraintImpl);
+ return (T) this;
+ }
}
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/SplitFactory.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/SplitFactory.java
index 63228ad23e0..75f4507f00b 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/SplitFactory.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/SplitFactory.java
@@ -18,19 +18,14 @@
*/
package org.jbpm.ruleflow.core.factory;
-import org.jbpm.process.instance.impl.ReturnValueConstraintEvaluator;
-import org.jbpm.process.instance.impl.ReturnValueEvaluator;
import org.jbpm.ruleflow.core.RuleFlowNodeContainerFactory;
-import org.jbpm.workflow.core.Node;
import org.jbpm.workflow.core.NodeContainer;
-import org.jbpm.workflow.core.impl.ConnectionRef;
import org.jbpm.workflow.core.node.Split;
import org.kie.api.definition.process.WorkflowElementIdentifier;
public class SplitFactory> extends NodeFactory, T> {
public static final String METHOD_TYPE = "type";
- public static final String METHOD_CONSTRAINT = "constraint";
public SplitFactory(T nodeContainerFactory, NodeContainer nodeContainer, WorkflowElementIdentifier id) {
super(nodeContainerFactory, nodeContainer, new Split(), id);
@@ -60,22 +55,4 @@ public SplitFactory constraint(WorkflowElementIdentifier toNodeId, String nam
public ConstraintFactory> constraintBuilder(WorkflowElementIdentifier toNodeId, String name, String type, String dialect, String constraint) {
return new ConstraintFactory<>(this, toNodeId, name, type, dialect, constraint);
}
-
- public SplitFactory constraint(WorkflowElementIdentifier toNodeId, String name, String type, String dialect, ReturnValueEvaluator evaluator, int priority) {
- return constraint(toNodeId, name, type, dialect, evaluator, priority, false);
- }
-
- public SplitFactory constraint(WorkflowElementIdentifier toNodeId, String name, String type, String dialect, ReturnValueEvaluator evaluator, int priority, boolean isDefault) {
- ReturnValueConstraintEvaluator constraintImpl = new ReturnValueConstraintEvaluator();
- constraintImpl.setName(name);
- constraintImpl.setType(type);
- constraintImpl.setDialect(dialect);
- constraintImpl.setPriority(priority);
- constraintImpl.setEvaluator(evaluator);
- constraintImpl.setConstraint("expression already given as evaluator");
- constraintImpl.setDefault(isDefault);
- getSplit().addConstraint(
- new ConnectionRef(name, toNodeId, Node.CONNECTION_DEFAULT_TYPE), constraintImpl);
- return this;
- }
}
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/StartNodeFactory.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/StartNodeFactory.java
index 3aa38c4b33a..2bd804707b9 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/StartNodeFactory.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/StartNodeFactory.java
@@ -18,21 +18,26 @@
*/
package org.jbpm.ruleflow.core.factory;
+import java.util.ArrayList;
import java.util.List;
import org.jbpm.process.core.event.EventTypeFilter;
+import org.jbpm.process.core.event.ExpressionEventTypeFilter;
import org.jbpm.process.core.timer.Timer;
+import org.jbpm.process.instance.impl.ReturnValueEvaluator;
import org.jbpm.ruleflow.core.RuleFlowNodeContainerFactory;
import org.jbpm.ruleflow.core.RuleFlowProcess;
import org.jbpm.workflow.core.NodeContainer;
import org.jbpm.workflow.core.impl.DataAssociation;
+import org.jbpm.workflow.core.impl.DataDefinition;
import org.jbpm.workflow.core.node.EventTrigger;
import org.jbpm.workflow.core.node.StartNode;
import org.kie.api.definition.process.WorkflowElementIdentifier;
import static org.jbpm.ruleflow.core.Metadata.MESSAGE_REF;
-public class StartNodeFactory> extends NodeFactory, T> {
+public class StartNodeFactory>
+ extends NodeFactory, T> {
public static final String METHOD_INTERRUPTING = "interrupting";
public static final String METHOD_TRIGGER = "trigger";
@@ -51,16 +56,25 @@ public StartNodeFactory interrupting(boolean interrupting) {
return this;
}
- public StartNodeFactory trigger(String triggerEventType, List dataAssociations) {
+ public StartNodeFactory trigger(String triggerEventType, List dataAssociations, ReturnValueEvaluator returnValueEvaluator) {
+ ExpressionEventTypeFilter eventFilter = new ExpressionEventTypeFilter(triggerEventType, returnValueEvaluator);
+ return this.trigger(eventFilter, dataAssociations);
+ }
+
+ public StartNodeFactory trigger(EventTypeFilter eventTypeFilter, List dataAssociations) {
EventTrigger trigger = new EventTrigger();
+ trigger.addEventFilter(eventTypeFilter);
+ dataAssociations.forEach(trigger::addInAssociation);
+ getStartNode().addTrigger(trigger);
+ return this;
+ }
+
+ public StartNodeFactory trigger(String triggerEventType, List dataAssociations) {
EventTypeFilter eventFilter = new EventTypeFilter();
eventFilter.setCorrelationManager(((RuleFlowProcess) getStartNode().getProcess()).getCorrelationManager());
eventFilter.setType(triggerEventType);
eventFilter.setMessageRef((String) getNode().getMetaData().get(MESSAGE_REF));
- trigger.addEventFilter(eventFilter);
- dataAssociations.forEach(trigger::addInAssociation);
- getStartNode().addTrigger(trigger);
- return this;
+ return this.trigger(eventFilter, dataAssociations);
}
public StartNodeFactory trigger(String triggerEventType, String target) {
@@ -68,17 +82,12 @@ public StartNodeFactory trigger(String triggerEventType, String target) {
}
public StartNodeFactory trigger(String triggerEventType, String source, String target) {
- EventTrigger trigger = new EventTrigger();
- EventTypeFilter eventFilter = new EventTypeFilter();
- eventFilter.setCorrelationManager(((RuleFlowProcess) getStartNode().getProcess()).getCorrelationManager());
- eventFilter.setMessageRef((String) getNode().getMetaData().get(MESSAGE_REF));
- eventFilter.setType(triggerEventType);
- trigger.addEventFilter(eventFilter);
+ List dataAssociations = new ArrayList<>();
if (source != null) {
- trigger.addInMapping(source, target);
+ dataAssociations.add(new DataAssociation(DataDefinition.toSimpleDefinition(source),
+ DataDefinition.toSimpleDefinition(target), null, null));
}
- getStartNode().addTrigger(trigger);
- return this;
+ return this.trigger(triggerEventType, dataAssociations);
}
public StartNodeFactory timer(String delay, String period, String date, int timeType) {
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/impl/MultiInstanceSpecification.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/impl/MultiInstanceSpecification.java
index 45f16168210..b5fae80fca4 100644
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/impl/MultiInstanceSpecification.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/impl/MultiInstanceSpecification.java
@@ -31,6 +31,8 @@ public class MultiInstanceSpecification implements Serializable {
private String completionCondition;
private boolean isSequential = false;
+ private String completionConditionLang;
+
public boolean hasMultiInstanceInput() {
return loopDataInputRef != null;
}
@@ -67,6 +69,14 @@ public DataDefinition getLoopDataInputRef() {
return loopDataInputRef;
}
+ public void setCompletionConditionLang(String completionConditionLang) {
+ this.completionConditionLang = completionConditionLang;
+ }
+
+ public String getCompletionConditionLang() {
+ return completionConditionLang;
+ }
+
public void setCompletionCondition(String completionCondition) {
this.completionCondition = completionCondition;
}
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/impl/NodeImpl.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/impl/NodeImpl.java
index 4410c19d6d3..0ea5dee5509 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/impl/NodeImpl.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/impl/NodeImpl.java
@@ -297,7 +297,7 @@ public Connection getFrom() {
if (list.size() == 1) {
return list.get(0);
}
- if ("true".equals(System.getProperty("jbpm.enable.multi.con"))) {
+ if (Boolean.parseBoolean((String) getProcess().getMetaData().get("jbpm.enable.multi.con"))) {
return list.get(0);
} else {
throw new IllegalArgumentException(
@@ -317,7 +317,7 @@ public Connection getTo() {
if (list.size() == 1) {
return list.get(0);
}
- if ("true".equals(System.getProperty("jbpm.enable.multi.con"))) {
+ if (Boolean.parseBoolean((String) getProcess().getMetaData().get("jbpm.enable.multi.con"))) {
return list.get(0);
} else {
throw new IllegalArgumentException(
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/ActionNode.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/ActionNode.java
index aff798ca7f7..9144d42833a 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/ActionNode.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/ActionNode.java
@@ -53,7 +53,7 @@ public void validateAddIncomingConnection(final String type, final Connection co
"This type of node [" + connection.getTo().getUniqueId() + ", " + connection.getTo().getName()
+ "] only accepts default incoming connection type!");
}
- if (getFrom() != null && !"true".equals(System.getProperty("jbpm.enable.multi.con"))) {
+ if (getFrom() != null && !Boolean.parseBoolean((String) getProcess().getMetaData().get("jbpm.enable.multi.con"))) {
throw new IllegalArgumentException(
"This type of node [" + connection.getTo().getUniqueId() + ", " + connection.getTo().getName()
+ "] cannot have more than one incoming connection!");
@@ -68,7 +68,7 @@ public void validateAddOutgoingConnection(final String type, final Connection co
"This type of node [" + connection.getFrom().getUniqueId() + ", " + connection.getFrom().getName()
+ "] only accepts default outgoing connection type!");
}
- if (getTo() != null && !"true".equals(System.getProperty("jbpm.enable.multi.con"))) {
+ if (getTo() != null && !Boolean.parseBoolean((String) getProcess().getMetaData().get("jbpm.enable.multi.con"))) {
throw new IllegalArgumentException(
"This type of node [" + connection.getFrom().getUniqueId() + ", " + connection.getFrom().getName()
+ "] cannot have more than one outgoing connection!");
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/EndNode.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/EndNode.java
index eb45e405908..ae88f439561 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/EndNode.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/EndNode.java
@@ -58,7 +58,7 @@ public void validateAddIncomingConnection(final String type, final Connection co
"This type of node [" + connection.getTo().getUniqueId() + ", " + connection.getTo().getName()
+ "] only accepts default incoming connection type!");
}
- if (getFrom() != null && !"true".equals(System.getProperty("jbpm.enable.multi.con"))) {
+ if (getFrom() != null && !Boolean.parseBoolean((String) getProcess().getMetaData().get("jbpm.enable.multi.con"))) {
throw new IllegalArgumentException(
"This type of node [" + connection.getTo().getUniqueId() + ", " + connection.getTo().getName()
+ "] cannot have more than one incoming connection!");
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/EventNode.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/EventNode.java
index 968ecb96df1..42d216f4835 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/EventNode.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/EventNode.java
@@ -104,7 +104,7 @@ public void validateAddIncomingConnection(final String type, final Connection co
"This type of node [" + connection.getTo().getUniqueId() + ", " + connection.getTo().getName()
+ "] only accepts default incoming connection type!");
}
- if (getFrom() != null && !"true".equals(System.getProperty("jbpm.enable.multi.con"))) {
+ if (getFrom() != null && !Boolean.parseBoolean((String) getProcess().getMetaData().get("jbpm.enable.multi.con"))) {
throw new IllegalArgumentException(
"This type of node [" + connection.getTo().getUniqueId() + ", " + connection.getTo().getName()
+ "] cannot have more than one incoming connection!");
@@ -119,7 +119,7 @@ public void validateAddOutgoingConnection(final String type, final Connection co
"This type of node [" + connection.getFrom().getUniqueId() + ", " + connection.getFrom().getName()
+ "] only accepts default outgoing connection type!");
}
- if (getTo() != null && !"true".equals(System.getProperty("jbpm.enable.multi.con"))) {
+ if (getTo() != null && !Boolean.parseBoolean((String) getProcess().getMetaData().get("jbpm.enable.multi.con"))) {
throw new IllegalArgumentException(
"This type of node [" + connection.getFrom().getUniqueId() + ", " + connection.getFrom().getName()
+ "] cannot have more than one outgoing connection!");
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/ForEachNode.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/ForEachNode.java
index a53a6aff11a..2bacf604303 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/ForEachNode.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/ForEachNode.java
@@ -27,6 +27,7 @@
import org.jbpm.process.core.context.variable.VariableScope;
import org.jbpm.process.core.datatype.DataType;
import org.jbpm.process.instance.impl.Action;
+import org.jbpm.process.instance.impl.ReturnValueEvaluator;
import org.jbpm.ruleflow.core.WorkflowElementIdentifierFactory;
import org.jbpm.workflow.core.Node;
import org.jbpm.workflow.core.impl.ConnectionImpl;
@@ -51,7 +52,7 @@ public class ForEachNode extends CompositeContextNode {
private String outputVariableName;
private String collectionExpression;
private String outputCollectionExpression;
- private String completionConditionExpression;
+ private ReturnValueEvaluator completionConditionExpression;
private Action finishAction;
private boolean waitForCompletion = true;
@@ -345,12 +346,12 @@ public Context getContext(String contextType, long id) {
return ctx;
}
- public String getCompletionConditionExpression() {
+ public ReturnValueEvaluator getCompletionConditionExpression() {
return completionConditionExpression;
}
public void setCompletionConditionExpression(
- String completionConditionExpression) {
+ ReturnValueEvaluator completionConditionExpression) {
this.completionConditionExpression = completionConditionExpression;
}
@@ -361,4 +362,8 @@ public boolean isSequential() {
public void setSequential(boolean sequential) {
this.getMultiInstanceSpecification().setSequential(sequential);
}
+
+ public boolean hasCompletionCondition() {
+ return completionConditionExpression != null;
+ }
}
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/MilestoneNode.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/MilestoneNode.java
index ddac709244c..7ffabedcda2 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/MilestoneNode.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/MilestoneNode.java
@@ -59,7 +59,7 @@ public void validateAddIncomingConnection(final String type, final Connection co
if (!Node.CONNECTION_DEFAULT_TYPE.equals(type)) {
throwValidationException(connection, "only accepts default incoming connection type!");
}
- if (getFrom() != null && !Boolean.parseBoolean(System.getProperty("jbpm.enable.multi.con"))) {
+ if (getFrom() != null && !Boolean.parseBoolean((String) getProcess().getMetaData().get("jbpm.enable.multi.con"))) {
throwValidationException(connection, "cannot have more than one incoming connection!");
}
}
@@ -70,7 +70,7 @@ public void validateAddOutgoingConnection(final String type, final Connection co
if (!Node.CONNECTION_DEFAULT_TYPE.equals(type)) {
throwValidationException(connection, "only accepts default outgoing connection type!");
}
- if (getTo() != null && !Boolean.parseBoolean(System.getProperty("jbpm.enable.multi.con"))) {
+ if (getTo() != null && !Boolean.parseBoolean((String) getProcess().getMetaData().get("jbpm.enable.multi.con"))) {
throwValidationException(connection, "cannot have more than one outgoing connection!");
}
}
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/RuleSetNode.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/RuleSetNode.java
index 5f3a242dd85..3d129f3b228 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/RuleSetNode.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/RuleSetNode.java
@@ -105,7 +105,7 @@ public void validateAddIncomingConnection(final String type, final Connection co
"This type of node [" + connection.getTo().getUniqueId() + ", " + connection.getTo().getName()
+ "] only accepts default incoming connection type!");
}
- if (getFrom() != null && !"true".equals(System.getProperty("jbpm.enable.multi.con"))) {
+ if (getFrom() != null && !Boolean.parseBoolean((String) getProcess().getMetaData().get("jbpm.enable.multi.con"))) {
throw new IllegalArgumentException(
"This type of node [" + connection.getTo().getUniqueId() + ", " + connection.getTo().getName()
+ "] cannot have more than one incoming connection!");
@@ -120,7 +120,7 @@ public void validateAddOutgoingConnection(final String type, final Connection co
"This type of node [" + connection.getFrom().getUniqueId() + ", " + connection.getFrom().getName()
+ "] only accepts default outgoing connection type!");
}
- if (getTo() != null && !"true".equals(System.getProperty("jbpm.enable.multi.con"))) {
+ if (getTo() != null && !Boolean.parseBoolean((String) getProcess().getMetaData().get("jbpm.enable.multi.con"))) {
throw new IllegalArgumentException(
"This type of node [" + connection.getFrom().getUniqueId() + ", " + connection.getFrom().getName()
+ "] cannot have more than one outgoing connection!");
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/Split.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/Split.java
index 20f90546da1..fe2114905c0 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/Split.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/Split.java
@@ -143,7 +143,7 @@ public void validateAddIncomingConnection(final String type, final Connection co
+ "] only accepts default incoming connection type!");
}
- if (!getIncomingConnections(Node.CONNECTION_DEFAULT_TYPE).isEmpty() && !"true".equals(System.getProperty("jbpm.enable.multi.con"))) {
+ if (!getIncomingConnections(Node.CONNECTION_DEFAULT_TYPE).isEmpty() && !Boolean.parseBoolean((String) getProcess().getMetaData().get("jbpm.enable.multi.con"))) {
throw new IllegalArgumentException(
"This type of node [" + connection.getTo().getUniqueId() + ", " + connection.getTo().getName()
+ "] cannot have more than one incoming connection!");
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/StartNode.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/StartNode.java
index cfc91ddeec9..3743bbd1573 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/StartNode.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/StartNode.java
@@ -92,7 +92,7 @@ public void validateAddOutgoingConnection(final String type, final Connection co
throw new IllegalArgumentException(
"A start node [" + this.getUniqueId() + ", " + this.getName() + "] only accepts default outgoing connection type!");
}
- if (getTo() != null && !"true".equals(System.getProperty("jbpm.enable.multi.con"))) {
+ if (getTo() != null && !Boolean.parseBoolean((String) getProcess().getMetaData().get("jbpm.enable.multi.con"))) {
throw new IllegalArgumentException(
"A start node [" + this.getUniqueId() + ", " + this.getName() + "] cannot have more than one outgoing connection!");
}
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/SubProcessNode.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/SubProcessNode.java
index 80b6f75f873..77f873ddc76 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/SubProcessNode.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/SubProcessNode.java
@@ -77,7 +77,7 @@ public void validateAddIncomingConnection(final String type, final Connection co
"This type of node [" + connection.getTo().getUniqueId() + ", " + connection.getTo().getName()
+ "] only accepts default incoming connection type!");
}
- if (getFrom() != null && !"true".equals(System.getProperty("jbpm.enable.multi.con"))) {
+ if (getFrom() != null && !Boolean.parseBoolean((String) getProcess().getMetaData().get("jbpm.enable.multi.con"))) {
throw new IllegalArgumentException(
"This type of node [" + connection.getTo().getUniqueId() + ", " + connection.getTo().getName()
+ "] cannot have more than one incoming connection!");
@@ -92,7 +92,7 @@ public void validateAddOutgoingConnection(final String type, final Connection co
"This type of node [" + connection.getFrom().getUniqueId() + ", " + connection.getFrom().getName()
+ "] only accepts default outgoing connection type!");
}
- if (getTo() != null && !"true".equals(System.getProperty("jbpm.enable.multi.con"))) {
+ if (getTo() != null && !Boolean.parseBoolean((String) getProcess().getMetaData().get("jbpm.enable.multi.con"))) {
throw new IllegalArgumentException(
"This type of node [" + connection.getFrom().getUniqueId() + ", " + connection.getFrom().getName()
+ "] cannot have more than one outgoing connection!");
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/TimerNode.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/TimerNode.java
index a3a4e29d95e..e8ce9a54957 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/TimerNode.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/TimerNode.java
@@ -45,7 +45,7 @@ public void validateAddIncomingConnection(final String type, final Connection co
"This type of node [" + connection.getTo().getUniqueId() + ", " + connection.getTo().getName()
+ "] only accepts default incoming connection type!");
}
- if (getFrom() != null && !"true".equals(System.getProperty("jbpm.enable.multi.con"))) {
+ if (getFrom() != null && !Boolean.parseBoolean((String) getProcess().getMetaData().get("jbpm.enable.multi.con"))) {
throw new IllegalArgumentException(
"This type of node [" + connection.getTo().getUniqueId() + ", " + connection.getTo().getName()
+ "] cannot have more than one incoming connection!");
@@ -60,7 +60,7 @@ public void validateAddOutgoingConnection(final String type, final Connection co
"This type of node [" + connection.getFrom().getUniqueId() + ", " + connection.getFrom().getName()
+ "] only accepts default outgoing connection type!");
}
- if (getTo() != null && !"true".equals(System.getProperty("jbpm.enable.multi.con"))) {
+ if (getTo() != null && !Boolean.parseBoolean((String) getProcess().getMetaData().get("jbpm.enable.multi.con"))) {
throw new IllegalArgumentException(
"This type of node [" + connection.getFrom().getUniqueId() + ", " + connection.getFrom().getName()
+ "] cannot have more than one outgoing connection!");
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/WorkItemNode.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/WorkItemNode.java
index dd1357b5ff7..d7cd3c06c19 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/WorkItemNode.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/WorkItemNode.java
@@ -66,7 +66,7 @@ public void validateAddIncomingConnection(final String type, final Connection co
"This type of node [" + connection.getTo().getUniqueId() + ", " + connection.getTo().getName()
+ "] only accepts default incoming connection type!");
}
- if (getFrom() != null && !"true".equals(System.getProperty("jbpm.enable.multi.con"))) {
+ if (getFrom() != null && !Boolean.parseBoolean((String) getProcess().getMetaData().get("jbpm.enable.multi.con"))) {
throw new IllegalArgumentException(
"This type of node [" + connection.getTo().getUniqueId() + ", " + connection.getTo().getName()
+ "] cannot have more than one incoming connection!");
@@ -81,7 +81,7 @@ public void validateAddOutgoingConnection(final String type, final Connection co
"This type of node [" + connection.getFrom().getUniqueId() + ", " + connection.getFrom().getName()
+ "] only accepts default outgoing connection type!");
}
- if (getTo() != null && !"true".equals(System.getProperty("jbpm.enable.multi.con"))) {
+ if (getTo() != null && !Boolean.parseBoolean((String) getProcess().getMetaData().get("jbpm.enable.multi.con"))) {
throw new IllegalArgumentException(
"This type of node [" + connection.getFrom().getUniqueId() + ", " + connection.getFrom().getName()
+ "] cannot have more than one outgoing connection!");
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/NodeInstanceImpl.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/NodeInstanceImpl.java
index f71a5ef44f4..a5e452a24a0 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/NodeInstanceImpl.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/NodeInstanceImpl.java
@@ -314,7 +314,7 @@ public void triggerCompleted(String type, boolean remove) {
List connections = null;
if (node != null) {
- if ("true".equals(System.getProperty("jbpm.enable.multi.con")) && !((NodeImpl) node).getConstraints().isEmpty()) {
+ if (Boolean.parseBoolean((String) getProcessInstance().getProcess().getMetaData().get("jbpm.enable.multi.con")) && !((NodeImpl) node).getConstraints().isEmpty()) {
int priority;
connections = ((NodeImpl) node).getDefaultOutgoingConnections();
boolean found = false;
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/WorkflowProcessInstanceImpl.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/WorkflowProcessInstanceImpl.java
index 434aca19b33..5f67bf1957b 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/WorkflowProcessInstanceImpl.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/WorkflowProcessInstanceImpl.java
@@ -602,6 +602,9 @@ private void registerExternalEventNodeListeners() {
if (getWorkflowProcess().getMetaData().containsKey(COMPENSATION)) {
addEventListener("Compensation", new CompensationEventListener(this), true);
}
+ if (getWorkflowProcess().getMetaData().containsKey(COMPENSATION)) {
+
+ }
}
private void unregisterExternalEventNodeListeners() {
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/node/ForEachNodeInstance.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/node/ForEachNodeInstance.java
index 0b5df806ffd..339f48d3f2a 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/node/ForEachNodeInstance.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/node/ForEachNodeInstance.java
@@ -31,8 +31,10 @@
import org.jbpm.process.core.context.variable.VariableScope;
import org.jbpm.process.instance.ContextInstance;
import org.jbpm.process.instance.ContextableInstance;
+import org.jbpm.process.instance.KogitoProcessContextImpl;
import org.jbpm.process.instance.context.variable.VariableScopeInstance;
import org.jbpm.process.instance.impl.Action;
+import org.jbpm.process.instance.impl.ReturnValueEvaluator;
import org.jbpm.ruleflow.core.Metadata;
import org.jbpm.util.ContextFactory;
import org.jbpm.workflow.core.Node;
@@ -239,22 +241,18 @@ public void internalTrigger(KogitoNodeInstance from, String type) {
Map tempVariables = new HashMap<>();
if (getForEachNode().getOutputVariableName() != null) {
+ Object outputVariable = from.getVariable(getForEachNode().getOutputVariableName());
Collection