}
}
LinkedList<Object> outputValues = new LinkedList<Object>();
LinkedList<String> outputKeywords = new LinkedList<String>();
for (Node outputNode : outoutNodes) {
OutputNode node = (OutputNode) outputNode;
List<DataPort> inputPorts = node.getInputPorts();
for (DataPort dataPort : inputPorts) {
Object val = InterpreterUtil.findInputFromPort(dataPort, this.invokerMap);
;
if (null == val) {
throw new WorkFlowInterpreterException("Unable to find output for the node:" + node.getID());
}
// Some node not yet updated
if (node.getState().equals(NodeExecutionState.FINISHED)) {
if (this.config.isActOnProvenance()) {
try {
if (val instanceof String) {
/**
TODO : saveWorkflowExecutionOutput() is not implemented in Registry
API or Airavata API at the moment
**/
this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager()
.saveWorkflowExecutionOutput(this.config.getTopic(), node.getName(), val.toString());
} else if (val instanceof org.xmlpull.v1.builder.XmlElement) {
this.getConfig()
.getConfiguration()
.getAiravataAPI().getProvenanceManager()
.saveWorkflowExecutionOutput(this.config.getTopic(), node.getName(),
XMLUtil.xmlElementToString((org.xmlpull.v1.builder.XmlElement) val));
}
} catch (AiravataAPIInvocationException e) {
e.printStackTrace(); // To change body of catch
// statement use File |
// Settings | File
// Templates.
}
}
if (val instanceof XmlElement) {
((OutputNode) node).setDescription(XMLUtil.xmlElementToString((XmlElement) val));
} else {
((OutputNode) node).setDescription(val.toString());
}
outputValues.add(val);
outputKeywords.add(dataPort.getID());
node.setState(NodeExecutionState.FINISHED);
}
}
}
this.config.getNotifier().sendingPartialResults(outputValues.toArray(), outputKeywords.toArray(new String[outputKeywords.size()]));