예제 #1
0
  public ListJobsResponse listJobs(ListJobsRequest request) {
    try {
      ListJobsResponse r = EndpointHelper.createResponse(ListJobsResponse.class, request);
      r.setJobs(jobDao.findJobs(request.getWorkflowId(), request.getJobState()));
      return r;

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(ListJobsResponse.class, request, e);
    }
  }
예제 #2
0
  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);
    }
  }