Search in sources :

Example 1 with UpdateExternalTaskRetriesBuilder

use of org.camunda.bpm.engine.externaltask.UpdateExternalTaskRetriesBuilder in project camunda-bpm-platform by camunda.

the class ExternalTaskRestServiceImpl method setRetries.

@Override
public void setRetries(SetRetriesForExternalTasksDto retriesDto) {
    UpdateExternalTaskRetriesBuilder builder = updateRetries(retriesDto);
    int retries = retriesDto.getRetries();
    try {
        builder.set(retries);
    } catch (NotFoundException e) {
        throw new InvalidRequestException(Status.NOT_FOUND, e.getMessage());
    } catch (BadUserRequestException e) {
        throw new InvalidRequestException(Status.BAD_REQUEST, e.getMessage());
    }
}
Also used : UpdateExternalTaskRetriesBuilder(org.camunda.bpm.engine.externaltask.UpdateExternalTaskRetriesBuilder) NotFoundException(org.camunda.bpm.engine.exception.NotFoundException) InvalidRequestException(org.camunda.bpm.engine.rest.exception.InvalidRequestException) BadUserRequestException(org.camunda.bpm.engine.BadUserRequestException)

Example 2 with UpdateExternalTaskRetriesBuilder

use of org.camunda.bpm.engine.externaltask.UpdateExternalTaskRetriesBuilder in project camunda-bpm-platform by camunda.

the class ExternalTaskRestServiceImpl method setRetriesAsync.

@Override
public BatchDto setRetriesAsync(SetRetriesForExternalTasksDto retriesDto) {
    UpdateExternalTaskRetriesBuilder builder = updateRetries(retriesDto);
    int retries = retriesDto.getRetries();
    try {
        Batch batch = builder.setAsync(retries);
        return BatchDto.fromBatch(batch);
    } catch (NotFoundException e) {
        throw new InvalidRequestException(Status.NOT_FOUND, e.getMessage());
    } catch (BadUserRequestException e) {
        throw new InvalidRequestException(Status.BAD_REQUEST, e.getMessage());
    }
}
Also used : UpdateExternalTaskRetriesBuilder(org.camunda.bpm.engine.externaltask.UpdateExternalTaskRetriesBuilder) Batch(org.camunda.bpm.engine.batch.Batch) NotFoundException(org.camunda.bpm.engine.exception.NotFoundException) InvalidRequestException(org.camunda.bpm.engine.rest.exception.InvalidRequestException) BadUserRequestException(org.camunda.bpm.engine.BadUserRequestException)

Aggregations

BadUserRequestException (org.camunda.bpm.engine.BadUserRequestException)2 NotFoundException (org.camunda.bpm.engine.exception.NotFoundException)2 UpdateExternalTaskRetriesBuilder (org.camunda.bpm.engine.externaltask.UpdateExternalTaskRetriesBuilder)2 InvalidRequestException (org.camunda.bpm.engine.rest.exception.InvalidRequestException)2 Batch (org.camunda.bpm.engine.batch.Batch)1