for (Timer timer: workItemNode.getTimers().keySet()) {
validateTimer(timer, node, process, errors);
}
}
} else if (node instanceof ForEachNode) {
final ForEachNode forEachNode = (ForEachNode) node;
String variableName = forEachNode.getVariableName();
if (variableName == null || "".equals(variableName)) {
errors.add(new ProcessValidationErrorImpl(process,
"ForEach node '" + node.getName() + "' [" + node.getId() + "] has no variable name"));
}
String collectionExpression = forEachNode.getCollectionExpression();
if (collectionExpression == null || "".equals(collectionExpression)) {
errors.add(new ProcessValidationErrorImpl(process,
"ForEach node '" + node.getName() + "' [" + node.getId() + "] has no collection expression"));
}
if (forEachNode.getDefaultIncomingConnections().size() == 0 && !acceptsNoIncomingConnections(node)) {
errors.add(new ProcessValidationErrorImpl(process,
"ForEach node '" + node.getName() + "' [" + node.getId() + "] has no incoming connection"));
}
if (forEachNode.getDefaultOutgoingConnections().size() == 0 && !acceptsNoOutgoingConnections(node)) {
errors.add(new ProcessValidationErrorImpl(process,
"ForEach node '" + node.getName() + "' [" + node.getId() + "] has no outgoing connection"));
}
// TODO: check, if no linked connections, for start and end node(s)
// if (forEachNode.getLinkedIncomingNode(org.drools.workflow.core.Node.CONNECTION_DEFAULT_TYPE) == null) {
// errors.add(new ProcessValidationErrorImpl(process,
// "ForEach node '" + node.getName() + "' [" + node.getId() + "] has no linked start node"));
// }
// if (forEachNode.getLinkedOutgoingNode(org.drools.workflow.core.Node.CONNECTION_DEFAULT_TYPE) == null) {
// errors.add(new ProcessValidationErrorImpl(process,
// "ForEach node '" + node.getName() + "' [" + node.getId() + "] has no linked end node"));
// }
validateNodes(forEachNode.getNodes(), errors, process);
} else if (node instanceof DynamicNode) {
final DynamicNode dynamicNode = (DynamicNode) node;
if (dynamicNode.getDefaultIncomingConnections().size() == 0) {
errors.add(new ProcessValidationErrorImpl(process,
"Dynamic node '" + node.getName() + "' [" + node.getId() + "] has no incoming connection"));