use of org.apache.airavata.model.application.io.OutputDataObjectType in project airavata by apache.
the class WorkflowInterpreter method setupNodeDetailsOutput.
private void setupNodeDetailsOutput(Node node) {
WorkflowNodeDetails nodeDetails = nodeInstanceList.get(node);
List<DataPort> outputPorts = node.getOutputPorts();
Map<String, String> outputData = nodeOutputData.get(node);
for (DataPort dataPort : outputPorts) {
String portInputValue = outputData.get(dataPort.getName());
OutputDataObjectType elem = new OutputDataObjectType();
elem.setName(dataPort.getName());
elem.setValue(portInputValue);
nodeDetails.addToNodeOutputs(elem);
}
try {
getExperimentCatalog().update(ExperimentCatalogModelType.WORKFLOW_NODE_DETAIL, nodeDetails, nodeDetails.getNodeInstanceId());
} catch (RegistryException e) {
log.error(e.getMessage(), e);
}
}
use of org.apache.airavata.model.application.io.OutputDataObjectType in project airavata by apache.
the class ApplicationRegister method createAppOutput.
protected OutputDataObjectType createAppOutput(String inputName, String value, DataType type, boolean isRequired, boolean requiredToCMD, String argument) {
OutputDataObjectType outputDataObjectType = new OutputDataObjectType();
if (inputName != null)
outputDataObjectType.setName(inputName);
if (value != null)
outputDataObjectType.setValue(value);
if (type != null)
outputDataObjectType.setType(type);
outputDataObjectType.setIsRequired(isRequired);
outputDataObjectType.setRequiredToAddedToCommandLine(requiredToCMD);
outputDataObjectType.setApplicationArgument(argument);
return outputDataObjectType;
}
use of org.apache.airavata.model.application.io.OutputDataObjectType in project airavata by apache.
the class ExperimentExecution method processMessage.
private void processMessage(MessageContext message) {
if (message.getType().equals(MessageType.EXPERIMENT)) {
try {
ExperimentStatusChangeEvent event = new ExperimentStatusChangeEvent();
TBase messageEvent = message.getEvent();
byte[] bytes = ThriftUtils.serializeThriftObject(messageEvent);
ThriftUtils.createThriftFromBytes(bytes, event);
ExperimentState expState = event.getState();
String expId = event.getExperimentId();
String gatewayId = event.getGatewayId();
if (expState.equals(ExperimentState.COMPLETED)) {
resultWriter.println("Results for experiment : " + expId + " of gateway Id : " + gatewayId);
resultWriter.println("=====================================================================");
resultWriter.println("Status : " + ExperimentState.COMPLETED.toString());
// check file transfers
List<OutputDataObjectType> experimentOutputs = airavata.getExperimentOutputs(authzToken, expId);
int i = 1;
for (OutputDataObjectType output : experimentOutputs) {
System.out.println("################ Experiment : " + expId + " COMPLETES ###################");
System.out.println("Output " + i + " : " + output.getValue());
resultWriter.println("Output " + i + " : " + output.getValue());
i++;
}
resultWriter.println("End of Results for Experiment : " + expId);
resultWriter.println("=====================================================================");
} else if (expState.equals(ExperimentState.FAILED)) {
resultWriter.println("Results for experiment : " + expId + " of gateway Id : " + gatewayId);
resultWriter.println("=====================================================================");
int j = 1;
resultWriter.println("Status : " + ExperimentState.FAILED.toString());
System.out.println("################ Experiment : " + expId + " FAILED ###################");
ExperimentModel experiment = airavata.getExperiment(authzToken, expId);
List<ErrorModel> errors = experiment.getErrors();
if (errors != null && !errors.isEmpty()) {
for (ErrorModel errorDetails : errors) {
System.out.println(errorDetails.getActualErrorMessage());
resultWriter.println("Actual Error : " + j + " : " + errorDetails.getActualErrorMessage());
resultWriter.println("User Friendly Message : " + j + " : " + errorDetails.getUserFriendlyMessage());
}
}
resultWriter.println("End of Results for Experiment : " + expId);
resultWriter.println("=====================================================================");
}
} catch (TException e) {
logger.error(e.getMessage(), e);
}
} else if (message.getType().equals(MessageType.JOB)) {
try {
JobStatusChangeEvent event = new JobStatusChangeEvent();
TBase messageEvent = message.getEvent();
byte[] bytes = ThriftUtils.serializeThriftObject(messageEvent);
ThriftUtils.createThriftFromBytes(bytes, event);
} catch (TException e) {
logger.error(e.getMessage(), e);
}
}
resultWriter.flush();
}
Aggregations