@ApiOperation(value = "Get a single job", tags = {"Jobs"}) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the job exists and is returned."), @ApiResponse(code = 404, message = "Indicates the requested job does not exist.") }) @RequestMapping(value = "/management/jobs/{jobId}", method = RequestMethod.GET, produces = "application/json") public JobResponse getJob(@ApiParam(name = "jobId", value="The id of the job to get.") @PathVariable String jobId, HttpServletRequest request) { Job job = managementService.createJobQuery().jobId(jobId).singleResult(); if (job == null) { throw new ActivitiObjectNotFoundException("Could not find a job with id '" + jobId + "'.", Job.class); } return restResponseFactory.createJobResponse(job); }
public Item loadSingleResult(String id) { Job job = managementService.createJobQuery().jobId(id).singleResult(); if (job != null) { return new JobListItem(job); } return null; }
@ApiOperation(value = "Get the exception stacktrace for a job", tags = {"Jobs"}) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the requested job was not found and the stacktrace has been returned. The response contains the raw stacktrace and always has a Content-type of text/plain."), @ApiResponse(code = 404, message = "Indicates the requested job was not found or the job doesn’t have an exception stacktrace. Status-description contains additional information about the error.") }) @RequestMapping(value = "/management/jobs/{jobId}/exception-stacktrace", method = RequestMethod.GET) public String getJobStacktrace(@ApiParam(name = "jobId", value="Id of the job to get the stacktrace for.") @PathVariable String jobId, HttpServletResponse response) { Job job = managementService.createJobQuery().jobId(jobId).singleResult(); if (job == null) { throw new ActivitiObjectNotFoundException("Could not find a job with id '" + jobId + "'.", Job.class); } String stackTrace = managementService.getJobExceptionStacktrace(job.getId()); if (stackTrace == null) { throw new ActivitiObjectNotFoundException("Job with id '" + job.getId() + "' doesn't have an exception stacktrace.", String.class); } response.setContentType("text/plain"); return stackTrace; }
query.jobId(allRequestParams.get("id"));
public JobDetailPanel(String jobId, JobPage jobPage) { this.managementService = ProcessEngines.getDefaultProcessEngine().getManagementService(); this.i18nManager = ExplorerApp.get().getI18nManager(); this.notificationManager = ExplorerApp.get().getNotificationManager(); this.job = managementService.createJobQuery().jobId(jobId).singleResult(); this.jobPage = jobPage; init(); }