From e19270b87d0faa7d1e5931a5cb674aa47f14d541 Mon Sep 17 00:00:00 2001 From: Maciej Swiderski Date: Wed, 13 Jun 2012 18:19:10 +0200 Subject: [PATCH] BZ807640 - Conditional sequence flow is not supported by jBPM engine --- .../org/jbpm/bpmn2/xml/ProcessHandler.java | 65 +++++++++----- .../org/jbpm/bpmn2/SimpleBPMNProcessTest.java | 19 ++++ .../BPMN2-ConditionalFlowWithoutGateway.bpmn2 | 73 +++++++++++++++ .../org/jbpm/compiler/ProcessBuilderImpl.java | 14 +++ ...ltiConditionalSequenceFlowNodeBuilder.java | 90 +++++++++++++++++++ .../builder/ProcessNodeBuilderRegistry.java | 7 ++ .../instance/impl/ConstraintEvaluator.java | 5 +- .../impl/ReturnValueConstraintEvaluator.java | 6 +- .../impl/RuleConstraintEvaluator.java | 3 +- .../org/jbpm/workflow/core/impl/NodeImpl.java | 44 +++++++++ .../org/jbpm/workflow/core/node/Split.java | 2 +- .../instance/impl/NodeInstanceImpl.java | 76 +++++++++++++++- .../workflow/instance/node/SplitInstance.java | 14 --- 13 files changed, 373 insertions(+), 45 deletions(-) create mode 100644 jbpm-bpmn2/src/test/resources/BPMN2-ConditionalFlowWithoutGateway.bpmn2 create mode 100644 jbpm-flow-builder/src/main/java/org/jbpm/process/builder/MultiConditionalSequenceFlowNodeBuilder.java diff --git a/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/ProcessHandler.java b/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/ProcessHandler.java index 9c729a4a51..a29217ac6d 100644 --- a/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/ProcessHandler.java +++ b/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/ProcessHandler.java @@ -298,30 +298,18 @@ public static void linkConnections(NodeContainer nodeContainer, List laneMa } } } + + private static Constraint buildConstraint(SequenceFlow connection, NodeImpl node) { + if (connection.getExpression() == null) { + return null; + } + + Constraint constraint = new ConstraintImpl(); + String defaultConnection = (String) node.getMetaData("Default"); + if (defaultConnection != null && defaultConnection.equals(connection.getId())) { + constraint.setDefault(true); + } + if (connection.getName() != null) { + constraint.setName(connection.getName()); + } else { + constraint.setName(""); + } + if (connection.getType() != null) { + constraint.setType(connection.getType()); + } else { + constraint.setType("code"); + } + if (connection.getLanguage() != null) { + constraint.setDialect(connection.getLanguage()); + } + if (connection.getExpression() != null) { + constraint.setConstraint(connection.getExpression()); + } + constraint.setPriority(connection.getPriority()); + + return constraint; + } } \ No newline at end of file diff --git a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/SimpleBPMNProcessTest.java b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/SimpleBPMNProcessTest.java index 5e93607116..de2dcbee7d 100644 --- a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/SimpleBPMNProcessTest.java +++ b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/SimpleBPMNProcessTest.java @@ -2533,6 +2533,25 @@ public void afterProcessStarted(ProcessStartedEvent event) { System.clearProperty("jbpm.enable.multi.con"); } + /** + * Conditional sequence flow is supported in Guvnor BPMN designer (even in minimal perspective), but jBPM engine cannot + * parse this definition: + * "This type of node cannot have more than one outgoing connection!" + */ + public void testConditionalFlow() throws Exception { + System.setProperty("jbpm.enable.multi.con", "true"); + String processId = "designer.conditional-flow"; + + KnowledgeBase kbase = createKnowledgeBase("BPMN2-ConditionalFlowWithoutGateway.bpmn2"); + StatefulKnowledgeSession ksession = createKnowledgeSession(kbase); + + WorkflowProcessInstance wpi = (WorkflowProcessInstance) ksession.startProcess(processId); + + assertProcessInstanceCompleted(wpi.getId(), ksession); + assertNodeTriggered(wpi.getId(), "start", "script", "end1"); + System.clearProperty("jbpm.enable.multi.con"); + } + public void testMultipleInOutgoingSequenceFlowsDisable() throws Exception { try { diff --git a/jbpm-bpmn2/src/test/resources/BPMN2-ConditionalFlowWithoutGateway.bpmn2 b/jbpm-bpmn2/src/test/resources/BPMN2-ConditionalFlowWithoutGateway.bpmn2 new file mode 100644 index 0000000000..eb21ce0eea --- /dev/null +++ b/jbpm-bpmn2/src/test/resources/BPMN2-ConditionalFlowWithoutGateway.bpmn2 @@ -0,0 +1,73 @@ + + + + + + + _1897CC4D-9026-42F4-A3E9-663EBD1B00F3 + + + _1897CC4D-9026-42F4-A3E9-663EBD1B00F3 + _99179D07-2AD3-4F1D-9851-11A6F92179C5 + _53A779A0-66A0-4A12-BD82-6CCDDE3D5CE9 + _0DD13F4B-C5E8-4AA3-84EE-B98461099FC4 + + + + _99179D07-2AD3-4F1D-9851-11A6F92179C5 + + + _53A779A0-66A0-4A12-BD82-6CCDDE3D5CE9 + + + _0DD13F4B-C5E8-4AA3-84EE-B98461099FC4 + + + + 1;]]> + + + 10;]]> + + + 100;]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jbpm-flow-builder/src/main/java/org/jbpm/compiler/ProcessBuilderImpl.java b/jbpm-flow-builder/src/main/java/org/jbpm/compiler/ProcessBuilderImpl.java index a49446f7de..e253779480 100644 --- a/jbpm-flow-builder/src/main/java/org/jbpm/compiler/ProcessBuilderImpl.java +++ b/jbpm-flow-builder/src/main/java/org/jbpm/compiler/ProcessBuilderImpl.java @@ -20,6 +20,7 @@ import java.io.StringReader; import java.util.ArrayList; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; @@ -36,6 +37,7 @@ import org.drools.compiler.ParserError; import org.drools.compiler.ProcessBuilder; import org.drools.compiler.ProcessLoadError; +import org.drools.compiler.ReturnValueDescr; import org.drools.definition.process.Connection; import org.drools.definition.process.Node; import org.drools.definition.process.NodeContainer; @@ -49,6 +51,7 @@ import org.jbpm.compiler.xml.ProcessSemanticModule; import org.jbpm.compiler.xml.XmlProcessReader; import org.jbpm.compiler.xml.processes.RuleFlowMigrator; +import org.jbpm.process.builder.MultiConditionalSequenceFlowNodeBuilder; import org.jbpm.process.builder.ProcessBuildContext; import org.jbpm.process.builder.ProcessNodeBuilder; import org.jbpm.process.builder.ProcessNodeBuilderRegistry; @@ -62,11 +65,15 @@ import org.jbpm.process.core.impl.ProcessImpl; import org.jbpm.process.core.validation.ProcessValidationError; import org.jbpm.process.core.validation.ProcessValidator; +import org.jbpm.process.instance.impl.ReturnValueConstraintEvaluator; +import org.jbpm.process.instance.impl.RuleConstraintEvaluator; import org.jbpm.ruleflow.core.RuleFlowProcess; import org.jbpm.ruleflow.core.validation.RuleFlowProcessValidator; import org.jbpm.workflow.core.Constraint; import org.jbpm.workflow.core.impl.ConnectionRef; +import org.jbpm.workflow.core.impl.ConstraintImpl; import org.jbpm.workflow.core.impl.DroolsConsequenceAction; +import org.jbpm.workflow.core.impl.NodeImpl; import org.jbpm.workflow.core.impl.WorkflowProcessImpl; import org.jbpm.workflow.core.node.ConstraintTrigger; import org.jbpm.workflow.core.node.EventNode; @@ -226,6 +233,13 @@ private void processNodes( buildContexts( (ContextContainer) node, context ); } + + if (System.getProperty("jbpm.enable.multi.con") != null) { + builder = ProcessNodeBuilderRegistry.INSTANCE.getNodeBuilder( NodeImpl.class ); + if (builder != null) { + builder.build(process, processDescr, context, node); + } + } } } diff --git a/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/MultiConditionalSequenceFlowNodeBuilder.java b/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/MultiConditionalSequenceFlowNodeBuilder.java new file mode 100644 index 0000000000..9ba3e7429c --- /dev/null +++ b/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/MultiConditionalSequenceFlowNodeBuilder.java @@ -0,0 +1,90 @@ +/* + * Copyright 2012 JBoss Inc + * + * Licensed 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.jbpm.process.builder; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import org.drools.compiler.ReturnValueDescr; +import org.drools.definition.process.Connection; +import org.drools.definition.process.Node; +import org.drools.definition.process.Process; +import org.drools.lang.descr.ProcessDescr; +import org.jbpm.process.builder.dialect.ProcessDialect; +import org.jbpm.process.builder.dialect.ProcessDialectRegistry; +import org.jbpm.process.instance.impl.ReturnValueConstraintEvaluator; +import org.jbpm.process.instance.impl.RuleConstraintEvaluator; +import org.jbpm.workflow.core.Constraint; +import org.jbpm.workflow.core.impl.ConnectionRef; +import org.jbpm.workflow.core.impl.ConstraintImpl; +import org.jbpm.workflow.core.impl.NodeImpl; +import org.jbpm.workflow.core.node.Split; + +public class MultiConditionalSequenceFlowNodeBuilder implements ProcessNodeBuilder { + + public void build(Process process, ProcessDescr processDescr, + ProcessBuildContext context, Node node) { + + Map constraints = ((NodeImpl) node).getConstraints(); + + // exclude split as it is handled with separate builder and nodes with non conditional sequence flows + if (node instanceof Split || constraints.size() == 0) { + return; + } + + // we need to clone the map, so we can update the original while iterating. + Map map = new HashMap( constraints ); + for ( Iterator> it = map.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = it.next(); + ConnectionRef connection = entry.getKey(); + ConstraintImpl constraint = (ConstraintImpl) entry.getValue(); + Connection outgoingConnection = null; + for (Connection out: ((NodeImpl) node).getDefaultOutgoingConnections()) { + if (out.getToType().equals(connection.getToType()) + && out.getTo().getId() == connection.getNodeId()) { + outgoingConnection = out; + } + } + if (outgoingConnection == null) { + throw new IllegalArgumentException("Could not find outgoing connection"); + } + if ( "rule".equals( constraint.getType() )) { + RuleConstraintEvaluator ruleConstraint = new RuleConstraintEvaluator(); + ruleConstraint.setDialect( constraint.getDialect() ); + ruleConstraint.setName( constraint.getName() ); + ruleConstraint.setPriority( constraint.getPriority() ); + ruleConstraint.setDefault( constraint.isDefault() ); + ((NodeImpl) node).setConstraint( outgoingConnection, ruleConstraint ); + } else if ( "code".equals( constraint.getType() ) ) { + ReturnValueConstraintEvaluator returnValueConstraint = new ReturnValueConstraintEvaluator(); + returnValueConstraint.setDialect( constraint.getDialect() ); + returnValueConstraint.setName( constraint.getName() ); + returnValueConstraint.setPriority( constraint.getPriority() ); + returnValueConstraint.setDefault( constraint.isDefault() ); + ((NodeImpl) node).setConstraint( outgoingConnection, returnValueConstraint ); + + ReturnValueDescr returnValueDescr = new ReturnValueDescr(); + returnValueDescr.setText( constraint.getConstraint() ); + + ProcessDialect dialect = ProcessDialectRegistry.getDialect( constraint.getDialect() ); + dialect.getReturnValueEvaluatorBuilder().build( context, returnValueConstraint, returnValueDescr, (NodeImpl) node ); + } + } + + } + +} diff --git a/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/ProcessNodeBuilderRegistry.java b/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/ProcessNodeBuilderRegistry.java index 5dfb7874b5..d3f4959264 100644 --- a/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/ProcessNodeBuilderRegistry.java +++ b/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/ProcessNodeBuilderRegistry.java @@ -4,6 +4,7 @@ import java.util.Map; import org.drools.definition.process.Node; +import org.jbpm.workflow.core.impl.NodeImpl; import org.jbpm.workflow.core.node.ActionNode; import org.jbpm.workflow.core.node.CompositeContextNode; import org.jbpm.workflow.core.node.EndNode; @@ -53,6 +54,8 @@ public ProcessNodeBuilderRegistry() { new EventBasedNodeBuilder() ); register( StateNode.class, new EventBasedNodeBuilder() ); + register( NodeImpl.class, + new MultiConditionalSequenceFlowNodeBuilder() ); } public void register(Class< ? extends Node> cls, @@ -64,4 +67,8 @@ public void register(Class< ? extends Node> cls, public ProcessNodeBuilder getNodeBuilder(Node node) { return this.registry.get( node.getClass() ); } + + public ProcessNodeBuilder getNodeBuilder(Class< ? extends Node> cls) { + return this.registry.get( cls ); + } } diff --git a/jbpm-flow/src/main/java/org/jbpm/process/instance/impl/ConstraintEvaluator.java b/jbpm-flow/src/main/java/org/jbpm/process/instance/impl/ConstraintEvaluator.java index 577e9db452..974e79b248 100644 --- a/jbpm-flow/src/main/java/org/jbpm/process/instance/impl/ConstraintEvaluator.java +++ b/jbpm-flow/src/main/java/org/jbpm/process/instance/impl/ConstraintEvaluator.java @@ -18,12 +18,11 @@ import org.drools.definition.process.Connection; import org.jbpm.workflow.core.Constraint; -import org.jbpm.workflow.instance.node.SplitInstance; +import org.jbpm.workflow.instance.NodeInstance; public interface ConstraintEvaluator extends Constraint { - // TODO: make this work for more than only splits - public boolean evaluate(SplitInstance instance, + public boolean evaluate(NodeInstance instance, Connection connection, Constraint constraint); } \ No newline at end of file diff --git a/jbpm-flow/src/main/java/org/jbpm/process/instance/impl/ReturnValueConstraintEvaluator.java b/jbpm-flow/src/main/java/org/jbpm/process/instance/impl/ReturnValueConstraintEvaluator.java index 9d1746c9ef..9fc52a910c 100644 --- a/jbpm-flow/src/main/java/org/jbpm/process/instance/impl/ReturnValueConstraintEvaluator.java +++ b/jbpm-flow/src/main/java/org/jbpm/process/instance/impl/ReturnValueConstraintEvaluator.java @@ -25,7 +25,9 @@ import org.drools.spi.CompiledInvoker; import org.drools.spi.ProcessContext; import org.drools.spi.Wireable; +import org.jbpm.process.instance.ProcessInstance; import org.jbpm.workflow.core.Constraint; +import org.jbpm.workflow.instance.NodeInstance; import org.jbpm.workflow.instance.node.SplitInstance; /** @@ -118,12 +120,12 @@ public ReturnValueEvaluator getReturnValueEvaluator() { return this.evaluator; } - public boolean evaluate(SplitInstance instance, + public boolean evaluate(NodeInstance instance, Connection connection, Constraint constraint) { Object value; try { - ProcessContext context = new ProcessContext(instance.getProcessInstance().getKnowledgeRuntime()); + ProcessContext context = new ProcessContext(((ProcessInstance)instance.getProcessInstance()).getKnowledgeRuntime()); context.setNodeInstance( instance ); value = this.evaluator.evaluate( context ); } catch ( Exception e ) { diff --git a/jbpm-flow/src/main/java/org/jbpm/process/instance/impl/RuleConstraintEvaluator.java b/jbpm-flow/src/main/java/org/jbpm/process/instance/impl/RuleConstraintEvaluator.java index 80794411dc..8e0423b182 100644 --- a/jbpm-flow/src/main/java/org/jbpm/process/instance/impl/RuleConstraintEvaluator.java +++ b/jbpm-flow/src/main/java/org/jbpm/process/instance/impl/RuleConstraintEvaluator.java @@ -24,6 +24,7 @@ import org.jbpm.process.instance.ProcessInstance; import org.jbpm.workflow.core.Constraint; import org.jbpm.workflow.core.Node; +import org.jbpm.workflow.instance.NodeInstance; import org.jbpm.workflow.instance.node.SplitInstance; /** @@ -95,7 +96,7 @@ public void setDefault(boolean isDefault) { this.isDefault = isDefault; } - public boolean evaluate(SplitInstance instance, + public boolean evaluate(NodeInstance instance, Connection connection, Constraint constraint) { WorkflowProcessInstance processInstance = instance.getProcessInstance(); diff --git a/jbpm-flow/src/main/java/org/jbpm/workflow/core/impl/NodeImpl.java b/jbpm-flow/src/main/java/org/jbpm/workflow/core/impl/NodeImpl.java index d51c1faef0..7ea2643b10 100644 --- a/jbpm-flow/src/main/java/org/jbpm/workflow/core/impl/NodeImpl.java +++ b/jbpm-flow/src/main/java/org/jbpm/workflow/core/impl/NodeImpl.java @@ -27,6 +27,7 @@ import org.drools.definition.process.NodeContainer; import org.jbpm.process.core.Context; import org.jbpm.process.core.ContextResolver; +import org.jbpm.workflow.core.Constraint; import org.jbpm.workflow.core.Node; import org.jbpm.workflow.core.node.CompositeNode; @@ -49,6 +50,8 @@ public abstract class NodeImpl implements Node, Serializable, ContextResolver { private NodeContainer nodeContainer; private Map contexts = new HashMap(); private Map metaData = new HashMap(); + + protected Map constraints = new HashMap(); public NodeImpl() { this.id = -1; @@ -272,4 +275,45 @@ public void setMetaData(Map metaData) { this.metaData = metaData; } + public Constraint getConstraint(final Connection connection) { + if ( connection == null ) { + throw new IllegalArgumentException( "connection is null" ); + } + + + ConnectionRef ref = new ConnectionRef(connection.getTo().getId(), connection.getToType()); + return this.constraints.get(ref); + + } + + public Constraint internalGetConstraint(final ConnectionRef ref) { + return this.constraints.get(ref); + } + + public void setConstraint(final Connection connection, + final Constraint constraint) { + if ( connection == null ) { + throw new IllegalArgumentException( "connection is null" ); + } + if (!getDefaultOutgoingConnections().contains(connection)) { + throw new IllegalArgumentException("connection is unknown:" + connection); + } + addConstraint( + new ConnectionRef(connection.getTo().getId(), connection.getToType()), + constraint); + + } + + public void addConstraint(ConnectionRef connectionRef, Constraint constraint) { + if (connectionRef == null) { + throw new IllegalArgumentException( + "A " + this.getName() + " node only accepts constraints linked to a connection"); + } + this.constraints.put(connectionRef, constraint); + } + + public Map getConstraints() { + return Collections.unmodifiableMap( this.constraints ); + } + } diff --git a/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/Split.java b/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/Split.java index 03ea1b5ef3..f458078739 100644 --- a/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/Split.java +++ b/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/Split.java @@ -61,7 +61,7 @@ public class Split extends NodeImpl implements Constrainable { private static final long serialVersionUID = 510l; private int type; - private Map constraints = new HashMap(); +// private Map constraints = new HashMap(); public Split() { this.type = TYPE_UNDEFINED; diff --git a/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/NodeInstanceImpl.java b/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/NodeInstanceImpl.java index b527abf53f..7d160715f1 100644 --- a/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/NodeInstanceImpl.java +++ b/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/NodeInstanceImpl.java @@ -19,6 +19,7 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; @@ -37,6 +38,7 @@ import org.jbpm.process.instance.ProcessInstance; import org.jbpm.process.instance.context.exclusive.ExclusiveGroupInstance; import org.jbpm.process.instance.context.variable.VariableScopeInstance; +import org.jbpm.process.instance.impl.ConstraintEvaluator; import org.jbpm.workflow.core.impl.NodeImpl; import org.jbpm.workflow.instance.WorkflowProcessInstance; import org.jbpm.workflow.instance.WorkflowRuntimeException; @@ -145,7 +147,64 @@ protected void triggerCompleted(String type, boolean remove) { Node node = getNode(); List connections = null; if (node != null) { - connections = node.getOutgoingConnections(type); + if (System.getProperty("jbpm.enable.multi.con") != null && ((NodeImpl) node).getConstraints().size() > 0) { + int priority = Integer.MAX_VALUE; + connections = ((NodeImpl)node).getDefaultOutgoingConnections(); + boolean found = false; + List nodeInstances = + new ArrayList(); + List outgoingCopy = new ArrayList(connections); + while (!outgoingCopy.isEmpty()) { + priority = Integer.MAX_VALUE; + Connection selectedConnection = null; + ConstraintEvaluator selectedConstraint = null; + for ( final Iterator iterator = outgoingCopy.iterator(); iterator.hasNext(); ) { + final Connection connection = (Connection) iterator.next(); + ConstraintEvaluator constraint = (ConstraintEvaluator) ((NodeImpl)node).getConstraint( connection ); + + if ( constraint != null + && constraint.getPriority() < priority + && !constraint.isDefault() ) { + priority = constraint.getPriority(); + selectedConnection = connection; + selectedConstraint = constraint; + } + } + if (selectedConstraint == null) { + break; + } + if (selectedConstraint.evaluate( this, + selectedConnection, + selectedConstraint ) ) { + nodeInstances.add(new NodeInstanceTrigger(followConnection(selectedConnection), selectedConnection.getToType())); + found = true; + } + outgoingCopy.remove(selectedConnection); + } + for (NodeInstanceTrigger nodeInstance: nodeInstances) { + // stop if this process instance has been aborted / completed + if (((org.jbpm.workflow.instance.NodeInstanceContainer) getNodeInstanceContainer()).getState() != ProcessInstance.STATE_ACTIVE) { + return; + } + triggerNodeInstance(nodeInstance.getNodeInstance(), nodeInstance.getToType()); + } + if ( !found ) { + for ( final Iterator iterator = connections.iterator(); iterator.hasNext(); ) { + final Connection connection = (Connection) iterator.next(); + ConstraintEvaluator constraint = (ConstraintEvaluator) ((NodeImpl)node).getConstraint( connection ); + if ( constraint.isDefault() ) { + triggerConnection(connection); + found = true; + break; + } + } + } + if ( !found ) { + throw new IllegalArgumentException( "Uncontrolled flow node could not find at least one valid outgoing connection " + getNode().getName() ); + } + } else { + connections = node.getOutgoingConnections(type); + } } if (connections == null || connections.isEmpty()) { ((org.jbpm.workflow.instance.NodeInstanceContainer) getNodeInstanceContainer()) @@ -309,4 +368,19 @@ public void setMetaData(String name, Object data) { this.metaData.put(name, data); } + protected class NodeInstanceTrigger { + private org.jbpm.workflow.instance.NodeInstance nodeInstance; + private String toType; + public NodeInstanceTrigger(org.jbpm.workflow.instance.NodeInstance nodeInstance, String toType) { + this.nodeInstance = nodeInstance; + this.toType = toType; + } + public org.jbpm.workflow.instance.NodeInstance getNodeInstance() { + return nodeInstance; + } + public String getToType() { + return toType; + } + } + } diff --git a/jbpm-flow/src/main/java/org/jbpm/workflow/instance/node/SplitInstance.java b/jbpm-flow/src/main/java/org/jbpm/workflow/instance/node/SplitInstance.java index f1a0082366..648de0d630 100644 --- a/jbpm-flow/src/main/java/org/jbpm/workflow/instance/node/SplitInstance.java +++ b/jbpm-flow/src/main/java/org/jbpm/workflow/instance/node/SplitInstance.java @@ -209,18 +209,4 @@ public void internalTrigger(final NodeInstance from, String type) { } } - private class NodeInstanceTrigger { - private org.jbpm.workflow.instance.NodeInstance nodeInstance; - private String toType; - public NodeInstanceTrigger(org.jbpm.workflow.instance.NodeInstance nodeInstance, String toType) { - this.nodeInstance = nodeInstance; - this.toType = toType; - } - public org.jbpm.workflow.instance.NodeInstance getNodeInstance() { - return nodeInstance; - } - public String getToType() { - return toType; - } - } }