Hello,
In my program I integrated Taverna for the execution of workflows without Gui.
By updating the classes from Taverna 1.4 to Taverna 1.5.1 I couldn't find the
freefluo classes (uk.ac.soton.itinnovation.freefluo.util.xml.XmlUtils).
But I found a WorkflowLauncher class in the JavaDoc, which enables executing a
workflow without the gui.
I tried to use the WorkflowLauncher too, but couldn't find the execute method
in 1.5.1. Only a main method, which returns no result.
So my question is, how can I easily execute a workflow without using the gui
and get a Map in return?
Here is an abstract of my former code:
String workflow = "RPSBlastWorkflowWithParameters.xml";
ScuflModel model = null;
EnactorProxy proxy = null;
File workflowXmlFile = new File(workflow);
Document jdomDoc;
jdomDoc = XmlUtils.jdomDocumentFromFile(workflowXmlFile);
// create a ScuflModel
model = new ScuflModel();
// populate the workflowXml as jdomDoc, the model
XScuflParser.populate(jdomDoc, model, null);
// connect to the webservice
proxy = FreefluoEnactorProxy.getInstance();
Map inputs = new HashMap();
inputs.put("sequence",DataThingFactory.bake(query.getSequence().toUpperCase()));
inputs.put("length", DataThingFactory.bake(new
Integer(query.getLength()).toString()));
// iterate over all parameters and add each parameter to input
Set params = parameters.keySet();
Iterator itparam = params.iterator();
while (itparam.hasNext()) {
String key = itparam.next().toString();
inputs.put(key, DataThingFactory.bake(parameters.get(key)
.toString()));
}
// create a instance of workflowInstance
WorkflowInstance workflow = null;
try{
workflow = proxy.compileWorkflow(model, inputs, null);
}
catch(Exception e){
e.printStackTrace();
}
workflow.run();
Map outputs = workflow.getOutput();
Thanks in advance!
Best regards,
Anika