Package org.camunda.bpm.engine.rest.exception

Examples of org.camunda.bpm.engine.rest.exception.InvalidRequestException


      }
      else if (Hal.APPLICATION_HAL_JSON_TYPE.equals(variant.getMediaType())) {
        return getHalTasks(uriInfo, firstResult, maxResults);
      }
    }
    throw new InvalidRequestException(Response.Status.NOT_ACCEPTABLE, "No acceptable content-type found");
  }
View Full Code Here


        } else if (op.equals(VariableQueryParameterDto.NOT_EQUALS_OPERATOR_NAME)) {
          query.variableValueNotEquals(variableName, variableValue);
        } else if (op.equals(VariableQueryParameterDto.LIKE_OPERATOR_NAME)) {
          query.variableValueLike(variableName, String.valueOf(variableValue));
        } else {
          throw new InvalidRequestException(Status.BAD_REQUEST, "Invalid variable comparator specified: " + op);
        }
      }
    }
  }
View Full Code Here

  public ExecutionDto getExecution() {
    RuntimeService runtimeService = engine.getRuntimeService();
    Execution execution = runtimeService.createExecutionQuery().executionId(executionId).singleResult();

    if (execution == null) {
      throw new InvalidRequestException(Status.NOT_FOUND, "Execution with id " + executionId + " does not exist");
    }

    return ExecutionDto.fromExecution(execution);
  }
View Full Code Here

      VariableMap variables = VariableValueDto.toMap(triggerDto.getVariables(), engine, objectMapper);
      runtimeService.signal(executionId, variables);

    } catch (RestException e) {
      String errorMessage = String.format("Cannot signal execution %s: %s", executionId, e.getMessage());
      throw new InvalidRequestException(e.getStatus(), e, errorMessage);

    } catch (ProcessEngineException e) {
      throw new RestException(Status.INTERNAL_SERVER_ERROR, e, "Cannot signal execution " + executionId + ": " + e.getMessage());

    }
View Full Code Here

  public JobDto getJob() {
    ManagementService managementService = engine.getManagementService();
    Job job = managementService.createJobQuery().jobId(jobId).singleResult();

    if (job == null) {
      throw new InvalidRequestException(Status.NOT_FOUND, "Job with id " + jobId + " does not exist");
    }

    return JobDto.fromJob(job);
  }
View Full Code Here

    try {
      ManagementService managementService = engine.getManagementService();
      String stacktrace = managementService.getJobExceptionStacktrace(jobId);
      return stacktrace;
    } catch (ProcessEngineException e) {
      throw new InvalidRequestException(Status.NOT_FOUND, e.getMessage());
    }
  }
View Full Code Here

  public void setJobRetries(JobRetriesDto dto) {
    try {
      ManagementService managementService = engine.getManagementService();
      managementService.setJobRetries(jobId, dto.getRetries());
    } catch (ProcessEngineException e) {
      throw new InvalidRequestException(Status.INTERNAL_SERVER_ERROR, e.getMessage());
    }
  }
View Full Code Here

  public void executeJob() {
    try {
      ManagementService managementService = engine.getManagementService();
      managementService.executeJob(this.jobId);
    } catch (ProcessEngineException e) {
      throw new InvalidRequestException(Status.NOT_FOUND, e.getMessage());
    } catch (RuntimeException r) {
      throw new RestException(Status.INTERNAL_SERVER_ERROR, r.getMessage());
    }
  }
View Full Code Here

  public void setJobDuedate(JobDuedateDto dto) {
    try {
      ManagementService managementService = engine.getManagementService();
      managementService.setJobDuedate(jobId, dto.getDuedate());
    } catch (ProcessEngineException e) {
      throw new InvalidRequestException(Status.INTERNAL_SERVER_ERROR, e.getMessage());
    }
  }
View Full Code Here

    ProcessDefinition definition;
    try {
      definition = repoService.getProcessDefinition(processDefinitionId);
    } catch (ProcessEngineException e) {
      throw new InvalidRequestException(Status.NOT_FOUND, e, "No matching definition with id " + processDefinitionId);
    }

    ProcessDefinitionDto result = ProcessDefinitionDto.fromProcessDefinition(definition);

    return result;
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.rest.exception.InvalidRequestException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.