use of org.apache.airavata.model.status.ProcessState in project airavata by apache.
the class WorkflowInterpreter method taskOutputChanged.
@Subscribe
public void taskOutputChanged(TaskOutputChangeEvent taskOutputEvent) {
String taskId = taskOutputEvent.getTaskIdentity().getTaskId();
if (isTaskAwaiting(taskId)) {
ProcessState state = ProcessState.COMPLETED;
Node node = getAwaitingNodeForTask(taskId);
List<OutputDataObjectType> applicationOutputs = taskOutputEvent.getOutput();
Map<String, String> outputData = new HashMap<String, String>();
for (OutputDataObjectType outputObj : applicationOutputs) {
List<DataPort> outputPorts = node.getOutputPorts();
for (DataPort dataPort : outputPorts) {
if (dataPort.getName().equals(outputObj.getName())) {
outputData.put(outputObj.getName(), outputObj.getValue());
}
}
}
nodeOutputData.put(node, outputData);
setupNodeDetailsOutput(node);
node.setState(NodeExecutionState.FINISHED);
try {
publishNodeStatusChange(WorkflowNodeState.COMPLETED, node.getID(), experiment.getExperimentID());
updateWorkflowNodeStatus(nodeInstanceList.get(node), state);
} catch (RegistryException e) {
log.error(e.getMessage(), e);
} catch (AiravataException e) {
log.error(e.getMessage(), e);
}
}
}
Aggregations