@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response getExperimentWorkflowInstances(@QueryParam("experimentId") String experimentId) {
AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
try {
List<WorkflowExecution> experimentWorkflowInstances = airavataRegistry.getExperimentWorkflowInstances(experimentId);
WorkflowInstancesList workflowInstancesList = new WorkflowInstancesList();
WorkflowExecution[] workflowInstances = new WorkflowExecution[experimentWorkflowInstances.size()];
for (int i = 0; i < experimentWorkflowInstances.size(); i++) {
workflowInstances[i] = experimentWorkflowInstances.get(i);
}
workflowInstancesList.setWorkflowInstances(workflowInstances);
if (experimentWorkflowInstances.size() != 0) {
Response.ResponseBuilder builder = Response.status(Response.Status.OK);
builder.entity(workflowInstancesList);
return builder.build();
} else {