// When you are starting 1st time its getting input from 1st node and
// invoking all the webservice components
if (readyNodes.size() != 1) {
throw new WorkflowRuntimeException("More than one dowhile execution not supported");
}
Node donode = readyNodes.get(0);
this.interpreter.handleWSComponent(donode);
log.info("Invoked service " + donode.getName());
List<DataPort> inputPorts = this.dowhilenode.getInputPorts();
boolean runflag = true;
while (runflag) {
while (true) {
if (NodeController.isRunning(donode) || NodeController.isWaiting(donode)) {
Thread.sleep(500);
log.info("Service " + donode.getName() + " waiting");
} else if (NodeController.isFinished(donode)) {
log.info("Service " + donode.getName() + " Finished");
List<DataPort> ports = this.dowhilenode.getOutputPorts();
for (int outputPortIndex = 0, inputPortIndex = 1; outputPortIndex < ports.size(); outputPortIndex++) {
Object inputValue = InterpreterUtil.findInputFromPort(this.dowhilenode.getInputPort(inputPortIndex), this.invokerMap);
dowhileinvoker.addOutput(this.dowhilenode.getOutputPort(outputPortIndex).getID(), inputValue);
}
break;
} else if (NodeController.isFailed(donode)) {
log.info("Service " + donode.getName() + " Failed");
runflag = false;
NodeController.getGUI(dowhilenode).setBodyColor(NodeState.FAILED.color);
this.threadExecutor.shutdown();
return false;
} else if (donode.isBreak()) {
log.info("Service " + donode.getName() + " set to break");
runflag = false;
break;
} else {
log.error("Service " + donode.getName() + " have unknow status");
throw new WorkFlowInterpreterException("Unknow status of the node");
}
}
this.invokerMap.put(this.dowhilenode, dowhileinvoker);
log.info("Going to evaluate do while expression for " + donode.getName());
if (!evaluate(this.dowhilenode, inputPorts, this.invokerMap)) {
log.info("Expression evaluation is false so calling EndDoWhile");
runflag = false;
} else {
if (readyNodes.size() != 1) {
throw new WorkFlowInterpreterException("More than one dowhile execution not supported");
}
Node whileNode = readyNodes.get(0);
// this.dowhilenode.getGUI().setBodyColor(NodeState.STARTING.color);
log.info("Expression evaluation is true so invoking service again " + whileNode.getName());
this.interpreter.handleWSComponent(whileNode);
}
}
// WS node should be done