use of org.camunda.bpm.engine.rest.exception.InvalidRequestException in project camunda-bpm-platform by camunda.
the class SignalRestServiceImpl method throwSignal.
@Override
public void throwSignal(SignalDto dto) {
String name = dto.getName();
if (name == null) {
throw new InvalidRequestException(Status.BAD_REQUEST, "No signal name given");
}
SignalEventReceivedBuilder signalEvent = createSignalEventReceivedBuilder(dto);
signalEvent.send();
}
use of org.camunda.bpm.engine.rest.exception.InvalidRequestException in project camunda-bpm-platform by camunda.
the class TaskRestServiceImpl method createTask.
public void createTask(TaskDto taskDto) {
ProcessEngine engine = getProcessEngine();
TaskService taskService = engine.getTaskService();
Task newTask = taskService.newTask(taskDto.getId());
taskDto.updateTask(newTask);
try {
taskService.saveTask(newTask);
} catch (NotValidException e) {
throw new InvalidRequestException(Status.BAD_REQUEST, e, "Could not save task: " + e.getMessage());
}
}
use of org.camunda.bpm.engine.rest.exception.InvalidRequestException in project camunda-bpm-platform by camunda.
the class TenantRestServiceImpl method createTenant.
public void createTenant(TenantDto dto) {
if (getIdentityService().isReadOnly()) {
throw new InvalidRequestException(Status.FORBIDDEN, "Identity service implementation is read-only.");
}
Tenant newTenant = getIdentityService().newTenant(dto.getId());
dto.update(newTenant);
getIdentityService().saveTenant(newTenant);
}
use of org.camunda.bpm.engine.rest.exception.InvalidRequestException in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceRestServiceImpl method deleteAsync.
public BatchDto deleteAsync(DeleteHistoricDecisionInstancesDto dto) {
HistoricDecisionInstanceQuery decisionInstanceQuery = null;
if (dto.getHistoricDecisionInstanceQuery() != null) {
decisionInstanceQuery = dto.getHistoricDecisionInstanceQuery().toQuery(processEngine);
}
try {
List<String> historicDecisionInstanceIds = dto.getHistoricDecisionInstanceIds();
String deleteReason = dto.getDeleteReason();
Batch batch = processEngine.getHistoryService().deleteHistoricDecisionInstancesAsync(historicDecisionInstanceIds, decisionInstanceQuery, deleteReason);
return BatchDto.fromBatch(batch);
} catch (BadUserRequestException e) {
throw new InvalidRequestException(Status.BAD_REQUEST, e.getMessage());
}
}
use of org.camunda.bpm.engine.rest.exception.InvalidRequestException in project camunda-bpm-platform by camunda.
the class GroupRestServiceImpl method createGroup.
public void createGroup(GroupDto groupDto) {
final IdentityService identityService = getIdentityService();
if (identityService.isReadOnly()) {
throw new InvalidRequestException(Status.FORBIDDEN, "Identity service implementation is read-only.");
}
Group newGroup = identityService.newGroup(groupDto.getId());
groupDto.update(newGroup);
identityService.saveGroup(newGroup);
}
Aggregations