result.setSuccessful(false);
result.setReport("The workflow " + action.getUrl() + " has not target port.");
return result;
}
HashMap<String, SSHInMemoryTempFile> requestedFiles = new HashMap<String, SSHInMemoryTempFile>(1);
SSHInMemoryTempFile tempFile = new SSHInMemoryTempFile();
requestedFiles.put(targetPathPort, tempFile);
tavernaExecutor.setOutputFiles(requestedFiles);
// Execute
try {
tavernaExecutor.execute();
} catch (IOException e) {
result.setSuccessful(false);
result.setReport("Error connecting to execution server");
log.error("Error connecting to execution server", e);
return result;
} catch (TavernaExecutorException e) {
result.setSuccessful(false);
result.setReport("Error executing taverna workflow");
log.error("Error executing taverna workflow", e);
return result;
}
result.setSuccessful(true);
result.setReport(tavernaExecutor.getOutputDoc());
Map<String, ?> outputFiles = tavernaExecutor.getOutputFiles();
DigitalObject u = new DigitalObject();
for (Entry<String, ?> entry : outputFiles.entrySet()) {
SSHInMemoryTempFile resultFile = (SSHInMemoryTempFile) entry.getValue();
u.getData().setData(resultFile.getData());
u.setFullname(action.getShortname() + " - " + digitalObject.getFullname());
}
FormatInfo tFormat = new FormatInfo();
result.setTargetFormat(tFormat);
result.setMigratedObject(u);