コード例 #1
0
  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);
    }
  }
コード例 #2
0
  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);
    }
  }
コード例 #3
0
  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);
    }
  }
コード例 #4
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);
    }
  }