if (!(node instanceof StartNodeDef)) {
try {
ParamChecker.validateActionName(node.getName());
}
catch (IllegalArgumentException ex) {
throw new WorkflowException(ErrorCode.E0724, ex.getMessage());
}
}
if (node instanceof ActionNodeDef) {
try {
Element action = XmlUtils.parseXml(node.getConf());
boolean supportedAction = Services.get().get(ActionService.class).getExecutor(action.getName()) != null;
if (!supportedAction) {
throw new WorkflowException(ErrorCode.E0723, node.getName(), action.getName());
}
}
catch (JDOMException ex) {
throw new RuntimeException("It should never happen, " + ex.getMessage(), ex);
}
}
if(node instanceof ForkNodeDef){
forkList.add(node.getName());
}
if(node instanceof JoinNodeDef){
joinList.add(node.getName());
}
if (node instanceof EndNodeDef) {
traversed.put(node.getName(), VisitStatus.VISITED);
return;
}
if (node instanceof KillNodeDef) {
traversed.put(node.getName(), VisitStatus.VISITED);
return;
}
for (String transition : node.getTransitions()) {
if (app.getNode(transition) == null) {
throw new WorkflowException(ErrorCode.E0708, node.getName(), transition);
}
//check if it is a cycle
if (traversed.get(app.getNode(transition).getName()) == VisitStatus.VISITING) {
throw new WorkflowException(ErrorCode.E0707, app.getNode(transition).getName());
}
//ignore validated one
if (traversed.get(app.getNode(transition).getName()) == VisitStatus.VISITED) {
continue;
}