protected void writeAttributes(CompositeNode compositeNode, StringBuilder xmlDump, boolean includeMeta) { ForEachNode forEachNode = (ForEachNode) compositeNode; String variableName = forEachNode.getVariableName(); if (variableName != null) { xmlDump.append("variableName=\"" + variableName + "\" "); } String collectionExpression = forEachNode.getCollectionExpression(); if (collectionExpression != null) { xmlDump.append("collectionExpression=\"" + XmlDumper.replaceIllegalChars(collectionExpression) + "\" "); } boolean waitForCompletion = forEachNode.isWaitForCompletion(); if (!waitForCompletion) { xmlDump.append("waitForCompletion=\"false\" "); } }
" <outputSet/>" + EOL + " </ioSpecification>" + EOL); String collectionExpression = forEachNode.getCollectionExpression(); if (collectionExpression != null) { xmlDump.append(
public void internalTrigger(org.kie.api.runtime.process.NodeInstance fromm, String type) { String collectionExpression = getForEachNode().getCollectionExpression(); Collection<?> collection = evaluateCollectionExpression(collectionExpression); ((NodeInstanceContainer) getNodeInstanceContainer()).removeNodeInstance(this); if (collection.isEmpty()) { ForEachNodeInstance.this.triggerCompleted(org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE, true); } else { List<NodeInstance> nodeInstances = new ArrayList<NodeInstance>(); for (Object o: collection) { String variableName = getForEachNode().getVariableName(); NodeInstance nodeInstance = (NodeInstance) ((NodeInstanceContainer) getNodeInstanceContainer()).getNodeInstance(getForEachSplitNode().getTo().getTo()); VariableScopeInstance variableScopeInstance = (VariableScopeInstance) nodeInstance.resolveContextInstance(VariableScope.VARIABLE_SCOPE, variableName); variableScopeInstance.setVariable(variableName, o); nodeInstances.add(nodeInstance); } for (NodeInstance nodeInstance: nodeInstances) { logger.debug( "Triggering [{}] in multi-instance loop.", ((NodeInstanceImpl) nodeInstance).getNodeId() ); ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).trigger(this, getForEachSplitNode().getTo().getToType()); } if (!getForEachNode().isWaitForCompletion()) { ForEachNodeInstance.this.triggerCompleted(org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE, false); } } }
"ForEach has no variable name"); String collectionExpression = forEachNode.getCollectionExpression(); if (collectionExpression == null || "".equals(collectionExpression)) { addErrorMessage(process,
protected void writeAttributes(CompositeNode compositeNode, StringBuilder xmlDump, boolean includeMeta) { ForEachNode forEachNode = (ForEachNode) compositeNode; String variableName = forEachNode.getVariableName(); if (variableName != null) { xmlDump.append("variableName=\"" + variableName + "\" "); } String collectionExpression = forEachNode.getCollectionExpression(); if (collectionExpression != null) { xmlDump.append("collectionExpression=\"" + XmlDumper.replaceIllegalChars(collectionExpression) + "\" "); } boolean waitForCompletion = forEachNode.isWaitForCompletion(); if (!waitForCompletion) { xmlDump.append("waitForCompletion=\"false\" "); } }
" <outputSet/>" + EOL + " </ioSpecification>" + EOL); String collectionExpression = forEachNode.getCollectionExpression(); if (collectionExpression != null) { xmlDump.append(
public void internalTrigger(org.kie.api.runtime.process.NodeInstance fromm, String type) { String collectionExpression = getForEachNode().getCollectionExpression(); Collection<?> collection = evaluateCollectionExpression(collectionExpression); ((NodeInstanceContainer) getNodeInstanceContainer()).removeNodeInstance(this); if (collection.isEmpty()) { ForEachNodeInstance.this.triggerCompleted(org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE, true); } else { List<NodeInstance> nodeInstances = new ArrayList<NodeInstance>(); for (Object o: collection) { String variableName = getForEachNode().getVariableName(); NodeInstance nodeInstance = (NodeInstance) ((NodeInstanceContainer) getNodeInstanceContainer()).getNodeInstance(getForEachSplitNode().getTo().getTo()); VariableScopeInstance variableScopeInstance = (VariableScopeInstance) nodeInstance.resolveContextInstance(VariableScope.VARIABLE_SCOPE, variableName); variableScopeInstance.setVariable(variableName, o); nodeInstances.add(nodeInstance); } for (NodeInstance nodeInstance: nodeInstances) { logger.debug( "Triggering [{}] in multi-instance loop.", ((NodeInstanceImpl) nodeInstance).getNodeId() ); ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).trigger(this, getForEachSplitNode().getTo().getToType()); } if (!getForEachNode().isWaitForCompletion()) { ForEachNodeInstance.this.triggerCompleted(org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE, false); } } }
"ForEach has no variable name"); String collectionExpression = forEachNode.getCollectionExpression(); if (collectionExpression == null || "".equals(collectionExpression)) { addErrorMessage(process,