start = (start < 1) ? 1 : start;
int len = (lenStr != null) ? Integer.parseInt(lenStr) : 50;
len = (len < 1) ? 50 : len;
BundleEngine bundleEngine = Services.get().get(BundleEngineService.class).getBundleEngine(getUser(request));
BulkResponseInfo bulkResponse = bundleEngine.getBulkJobs(bulkFilter, start, len);
List<BulkResponseImpl> responsesToJson = bulkResponse.getResponses();
json.put(JsonTags.BULK_RESPONSES, BulkResponseImpl.toJSONArray(responsesToJson, timeZoneId));
json.put(JsonTags.BULK_RESPONSE_TOTAL, bulkResponse.getTotal());
json.put(JsonTags.BULK_RESPONSE_OFFSET, bulkResponse.getStart());
json.put(JsonTags.BULK_RESPONSE_LEN, bulkResponse.getLen());
}
catch (BaseEngineException ex) {
throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ex);
}