try {
Map<String, String> workflows = airavataRegistry.getWorkflows();
WorkflowList workflowList = new WorkflowList();
List<Workflow> workflowsModels = new ArrayList<Workflow>();
for (String workflowName : workflows.keySet()) {
Workflow workflow = new Workflow();
workflow.setWorkflowName(workflowName);
String workflowGraph = workflows.get(workflowName);
if (isJson && workflowGraph.startsWith("<")) {
workflowGraph = getJSONWorkflowGraph(workflowGraph);
}
workflow.setWorkflowGraph(workflowGraph);
workflowsModels.add(workflow);
}
workflowList.setWorkflowList(workflowsModels);
Response.ResponseBuilder builder = Response.status(Response.Status.OK);
builder.entity(workflowList);