Search in sources :

Example 26 with InvalidRequestException

use of org.camunda.bpm.engine.rest.exception.InvalidRequestException in project camunda-bpm-platform by camunda.

the class HistoricJobLogResourceImpl method getHistoricJobLog.

public HistoricJobLogDto getHistoricJobLog() {
    HistoryService historyService = engine.getHistoryService();
    HistoricJobLog historicJobLog = historyService.createHistoricJobLogQuery().logId(id).singleResult();
    if (historicJobLog == null) {
        throw new InvalidRequestException(Status.NOT_FOUND, "Historic job log with id " + id + " does not exist");
    }
    return HistoricJobLogDto.fromHistoricJobLog(historicJobLog);
}
Also used : HistoricJobLog(org.camunda.bpm.engine.history.HistoricJobLog) HistoryService(org.camunda.bpm.engine.HistoryService) InvalidRequestException(org.camunda.bpm.engine.rest.exception.InvalidRequestException)

Example 27 with InvalidRequestException

use of org.camunda.bpm.engine.rest.exception.InvalidRequestException in project camunda-bpm-platform by camunda.

the class GroupResourceImpl method updateGroup.

public void updateGroup(GroupDto group) {
    ensureNotReadOnly();
    Group dbGroup = findGroupObject();
    if (dbGroup == null) {
        throw new InvalidRequestException(Status.NOT_FOUND, "Group with id " + resourceId + " does not exist");
    }
    group.update(dbGroup);
    identityService.saveGroup(dbGroup);
}
Also used : Group(org.camunda.bpm.engine.identity.Group) InvalidRequestException(org.camunda.bpm.engine.rest.exception.InvalidRequestException)

Example 28 with InvalidRequestException

use of org.camunda.bpm.engine.rest.exception.InvalidRequestException in project camunda-bpm-platform by camunda.

the class TenantResourceImpl method updateTenant.

public void updateTenant(TenantDto tenantDto) {
    ensureNotReadOnly();
    Tenant tenant = findTenantObject();
    if (tenant == null) {
        throw new InvalidRequestException(Status.NOT_FOUND, "Tenant with id " + resourceId + " does not exist");
    }
    tenantDto.update(tenant);
    identityService.saveTenant(tenant);
}
Also used : Tenant(org.camunda.bpm.engine.identity.Tenant) InvalidRequestException(org.camunda.bpm.engine.rest.exception.InvalidRequestException)

Example 29 with InvalidRequestException

use of org.camunda.bpm.engine.rest.exception.InvalidRequestException in project camunda-bpm-platform by camunda.

the class HistoricExternalTaskLogResourceImpl method getHistoricExternalTaskLog.

@Override
public HistoricExternalTaskLogDto getHistoricExternalTaskLog() {
    HistoryService historyService = engine.getHistoryService();
    HistoricExternalTaskLog historicExternalTaskLog = historyService.createHistoricExternalTaskLogQuery().logId(id).singleResult();
    if (historicExternalTaskLog == null) {
        throw new InvalidRequestException(Status.NOT_FOUND, "Historic external task log with id " + id + " does not exist");
    }
    return HistoricExternalTaskLogDto.fromHistoricExternalTaskLog(historicExternalTaskLog);
}
Also used : HistoryService(org.camunda.bpm.engine.HistoryService) InvalidRequestException(org.camunda.bpm.engine.rest.exception.InvalidRequestException) HistoricExternalTaskLog(org.camunda.bpm.engine.history.HistoricExternalTaskLog)

Example 30 with InvalidRequestException

use of org.camunda.bpm.engine.rest.exception.InvalidRequestException in project camunda-bpm-platform by camunda.

the class FetchAndLockHandlerImpl method errorTooManyRequests.

protected void errorTooManyRequests(AsyncResponse asyncResponse) {
    String errorMessage = "At the moment the server has to handle too many requests at the same time. Please try again later.";
    // status code 429 would fit better
    InvalidRequestException invalidRequestException = new InvalidRequestException(Status.INTERNAL_SERVER_ERROR, errorMessage);
    asyncResponse.resume(invalidRequestException);
}
Also used : InvalidRequestException(org.camunda.bpm.engine.rest.exception.InvalidRequestException)

Aggregations

InvalidRequestException (org.camunda.bpm.engine.rest.exception.InvalidRequestException)116 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)30 RestException (org.camunda.bpm.engine.rest.exception.RestException)25 AuthorizationException (org.camunda.bpm.engine.AuthorizationException)20 NotValidException (org.camunda.bpm.engine.exception.NotValidException)12 ArrayList (java.util.ArrayList)11 BadUserRequestException (org.camunda.bpm.engine.BadUserRequestException)11 ManagementService (org.camunda.bpm.engine.ManagementService)11 NotFoundException (org.camunda.bpm.engine.exception.NotFoundException)11 VariableQueryParameterDto (org.camunda.bpm.engine.rest.dto.VariableQueryParameterDto)10 HistoryService (org.camunda.bpm.engine.HistoryService)9 RuntimeService (org.camunda.bpm.engine.RuntimeService)9 InputStream (java.io.InputStream)8 RepositoryService (org.camunda.bpm.engine.RepositoryService)8 Batch (org.camunda.bpm.engine.batch.Batch)8 URI (java.net.URI)6 VariableMap (org.camunda.bpm.engine.variable.VariableMap)6 ByteArrayInputStream (java.io.ByteArrayInputStream)5 FormService (org.camunda.bpm.engine.FormService)5 HistoricProcessInstanceQuery (org.camunda.bpm.engine.history.HistoricProcessInstanceQuery)5