VariableMap variables = VariableValueDto.toMap(dto.getVariables(), engine, objectMapper);
formService.submitTaskForm(taskId, variables);
} catch (RestException e) {
String errorMessage = String.format("Cannot submit task form %s: %s", taskId, e.getMessage());
throw new InvalidRequestException(e.getStatus(), e, errorMessage);
} catch (ProcessEngineException e) {
String errorMessage = String.format("Cannot submit task form %s: %s", taskId, e.getMessage());
throw new RestException(Status.INTERNAL_SERVER_ERROR, e, errorMessage);
}