workflowDescription.readMetadata();
if (!workflowDescription.getProfile().equals("http://purl.org/DP/components#Characterisation")
&& !workflowDescription.getProfile().equals("http://purl.org/DP/components#QAObjectComparison")) {
LOG.warn("The workflow {} is no CC or QA component.", service.getDescriptor());
throw new EvaluatorException("The workflow " + service.getDescriptor() + " is no CC or QA component.");
}
// Input
if (workflowDescription.getProfile().equals("http://purl.org/DP/components#Characterisation")) {
setCCInputData(workflowDescription, result, tavernaExecutor);
} else {
setQAInputData(workflowDescription, sample, result, tavernaExecutor);
}
// Workflow
tavernaExecutor.setWorkflow(service.getContentUri());
// Output ports to receive
List<Port> outputPorts = workflowDescription.getOutputPorts();
Set<String> outputPortNames = new HashSet<String>(outputPorts.size());
for (Port p : outputPorts) {
outputPortNames.add(p.getName());
}
tavernaExecutor.setOutputPorts(outputPortNames);
// Execute
try {
tavernaExecutor.execute();
} catch (IOException e) {
LOG.error("Error connecting to execution server", e);
throw new EvaluatorException("Error connecting to execution server", e);
} catch (TavernaExecutorException e) {
LOG.error("Error executing taverna workflow", e);
throw new EvaluatorException("Error executing taverna workflow", e);
}
Map<String, ?> outputData = tavernaExecutor.getOutputData();
for (Port p : outputPorts) {
String measure = p.getValue();