/**
* Visits Loni Pipeline ModuleGroup and converts into corresponding Taverna Dataflow object.
*/
public Object visit(ModuleGroup moduleGroup){
this.moduleGroup = moduleGroup;
Dataflow dataflow;
// Initialize parameters to construct Dataflow object
String name = moduleGroup.getName();
AnnotatedGranularDepthInputPorts inputPorts = new AnnotatedGranularDepthInputPorts();
AnnotatedGranularDepthOutputPorts outputPorts = new AnnotatedGranularDepthOutputPorts();
Processors processors = new Processors();
Conditions conditions = new Conditions();
Datalinks datalinks = (Datalinks) visit(pipeline.getConnections());
Annotations annotations = new Annotations();
String id = UUID.randomUUID().toString();
String role = "top";
dataflow = new Dataflow(name, inputPorts, outputPorts, processors, conditions, datalinks, annotations, id, role);
this.dataflow = dataflow; // set environment variable for visitor
// Add Title and Description
annotations.addAnnotationChain("DescriptiveTitle", moduleGroup.getName(), null);
annotations.addAnnotationChain("FreeTextDescription", moduleGroup.getDescription(), null);