use of org.camunda.bpm.engine.rest.exception.InvalidRequestException in project camunda-bpm-platform by camunda.
the class CaseExecutionResourceImpl method getCaseExecution.
public CaseExecutionDto getCaseExecution() {
CaseService caseService = engine.getCaseService();
CaseExecution execution = caseService.createCaseExecutionQuery().caseExecutionId(caseExecutionId).singleResult();
if (execution == null) {
throw new InvalidRequestException(Status.NOT_FOUND, "Case execution with id " + caseExecutionId + " does not exist.");
}
CaseExecutionDto result = CaseExecutionDto.fromCaseExecution(execution);
return result;
}
use of org.camunda.bpm.engine.rest.exception.InvalidRequestException in project camunda-bpm-platform by camunda.
the class CaseInstanceResourceImpl method getCaseInstance.
public CaseInstanceDto getCaseInstance() {
CaseService caseService = engine.getCaseService();
CaseInstance instance = caseService.createCaseInstanceQuery().caseInstanceId(caseInstanceId).singleResult();
if (instance == null) {
throw new InvalidRequestException(Status.NOT_FOUND, "Case instance with id " + caseInstanceId + " does not exist.");
}
CaseInstanceDto result = CaseInstanceDto.fromCaseInstance(instance);
return result;
}
use of org.camunda.bpm.engine.rest.exception.InvalidRequestException in project camunda-bpm-platform by camunda.
the class JobResourceImpl method executeJob.
@Override
public void executeJob() {
try {
ManagementService managementService = engine.getManagementService();
managementService.executeJob(this.jobId);
} catch (AuthorizationException e) {
throw e;
} catch (ProcessEngineException e) {
throw new InvalidRequestException(Status.NOT_FOUND, e.getMessage());
} catch (RuntimeException r) {
throw new RestException(Status.INTERNAL_SERVER_ERROR, r.getMessage());
}
}
use of org.camunda.bpm.engine.rest.exception.InvalidRequestException in project camunda-bpm-platform by camunda.
the class JobResourceImpl method getStacktrace.
@Override
public String getStacktrace() {
try {
ManagementService managementService = engine.getManagementService();
String stacktrace = managementService.getJobExceptionStacktrace(jobId);
return stacktrace;
} catch (AuthorizationException e) {
throw e;
} catch (ProcessEngineException e) {
throw new InvalidRequestException(Status.NOT_FOUND, e.getMessage());
}
}
use of org.camunda.bpm.engine.rest.exception.InvalidRequestException in project camunda-bpm-platform by camunda.
the class JobResourceImpl method setJobRetries.
@Override
public void setJobRetries(RetriesDto dto) {
try {
ManagementService managementService = engine.getManagementService();
managementService.setJobRetries(jobId, dto.getRetries());
} catch (AuthorizationException e) {
throw e;
} catch (ProcessEngineException e) {
throw new InvalidRequestException(Status.INTERNAL_SERVER_ERROR, e.getMessage());
}
}
Aggregations