public EndpointResponse updateWorkflow(UpdateWorkflowRequest request) { try { workflowDao.update(request.getWorkflow()); return EndpointHelper.createResponse(EndpointResponse.class, request); } catch (Exception e) { return EndpointHelper.createErrorResponse(EndpointResponse.class, request, e); } }
public ListWorkflowsResponse listWorkflows(ListWorkflowsRequest request) { try { ListWorkflowsResponse r = EndpointHelper.createResponse(ListWorkflowsResponse.class, request); r.setWorkflows(workflowDao.findWorkflowsInState(request.getWorkflowState())); return r; } catch (Exception e) { return EndpointHelper.createErrorResponse(ListWorkflowsResponse.class, request, e); } }
public FindWorkflowResponse findWorkflow(FindWorkflowRequest request) { try { FindWorkflowResponse r = EndpointHelper.createResponse(FindWorkflowResponse.class, request); r.setWorkflow(workflowDao.get(request.getWorkflowId())); return r; } catch (Exception e) { return EndpointHelper.createErrorResponse(FindWorkflowResponse.class, request, e); } }
public EndpointResponse removeWorkflow(RemoveWorkflowRequest request) { try { workflowDao.remove(request.getWorkflowId()); for (Job j : jobDao.findJobs(request.getWorkflowId(), null)) { jobDao.remove(j.get_id()); } return EndpointHelper.createResponse(EndpointResponse.class, request); } catch (Exception e) { return EndpointHelper.createErrorResponse(EndpointResponse.class, request, e); } }