String lenStr = request.getParameter(RestConstants.LEN_PARAM);
int start = (startStr != null) ? Integer.parseInt(startStr) : 1;
start = (start < 1) ? 1 : start;
int len = (lenStr != null) ? Integer.parseInt(lenStr) : 50;
len = (len < 1) ? 50 : len;
DagEngine dagEngine = Services.get().get(DagEngineService.class).getDagEngine(getUser(request),
getAuthToken(request));
WorkflowsInfo jobs = dagEngine.getJobs(filter, start, len);
List<WorkflowJobBean> jsonWorkflows = jobs.getWorkflows();
json.put(JsonTags.WORKFLOWS_JOBS, WorkflowJobBean.toJSONArray(jsonWorkflows));
json.put(JsonTags.WORKFLOWS_TOTAL, jobs.getTotal());
json.put(JsonTags.WORKFLOWS_OFFSET, jobs.getStart());
json.put(JsonTags.WORKFLOWS_LEN, jobs.getLen());