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

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


          commandBuilder.setVariable(variableName, variableValue.toTypedValue(engine, objectMapper));
        }

      } catch (RestException e) {
        String errorMessage = String.format("Cannot %s case instance %s due to invalid variable %s: %s", transition, caseInstanceId, variableName, e.getMessage());
        throw new RestException(e.getStatus(), e, errorMessage);

      }
    }
  }
View Full Code Here


    return new InvalidRequestException(status, cause, errorMessage);
  }

  protected RestException createRestException(String transition, Status status, ProcessEngineException cause) {
    String errorMessage = String.format("Cannot %s case execution %s: %s", transition, caseExecutionId, cause.getMessage());
    return new RestException(status, cause, errorMessage);
  }
View Full Code Here

          commandBuilder.setVariable(variableName, typedValue);
        }

      } catch (RestException e) {
        String errorMessage = String.format("Cannot %s case execution %s due to invalid variable %s: %s", transition, caseExecutionId, variableName, e.getMessage());
        throw new RestException(e.getStatus(), e, errorMessage);

      }
    }
  }
View Full Code Here

    if(iterator.hasNext()) {
      ProcessEngineProvider provider = iterator.next();
      return provider;
    } else {
      throw new RestException(Status.INTERNAL_SERVER_ERROR, "No process engine provider found");
    }
  }
View Full Code Here

    ProcessDefinition processDefinition = processDefinitionQuery.latestVersion().singleResult();

    if (processDefinition == null) {
      String errorMessage = String.format("No matching process definition with key: %s ", processDefinitionKey);
      throw new RestException(Status.NOT_FOUND, errorMessage);
    }

    ProcessDefinitionResource processDefinitionResource = getProcessDefinitionById(processDefinition.getId());

    return processDefinitionResource;
View Full Code Here

    CaseDefinition caseDefinition = query.singleResult();

    if (caseDefinition == null) {
      String errorMessage = String.format("No matching case definition with key: %s ", caseDefinitionKey);
      throw new RestException(Status.NOT_FOUND, errorMessage);
    }

    return getCaseDefinitionById(caseDefinition.getId());
  }
View Full Code Here

  public static <T> T resolveFromContext(Providers providers, Class<T> clazz, MediaType mediaType, Class<?> type) {
    ContextResolver<T> contextResolver = providers.getContextResolver(clazz, mediaType);

    if (contextResolver == null) {
      throw new RestException("No context resolver found for class " + clazz.getName());
    }

    return contextResolver.getContext(type);
  }
View Full Code Here

        return provider.getDefaultProcessEngine();
      } else {
        return provider.getProcessEngine(engineName);
      }
    } else {
      throw new RestException(Status.INTERNAL_SERVER_ERROR, "Could not find an implementation of the "+ProcessEngineProvider.class+"- SPI");
    }
  }
View Full Code Here

      return Variables.untypedValue(value);
    }

    ValueType valueType = valueTypeResolver.typeForName(fromRestApiTypeName(type));
    if(valueType == null) {
      throw new RestException(Status.BAD_REQUEST, String.format("Unsupported value type '%s'", type));
    }
    else {
      if(valueType instanceof PrimitiveValueType) {
        PrimitiveValueType primitiveValueType = (PrimitiveValueType) valueType;
        Class<?> javaType = primitiveValueType.getJavaType();
View Full Code Here

    }
    else if (variableScopeId.equals(variableInstance.getCaseExecutionId())) {
      return generateCaseExecutionVariableValue(variableInstance, variableScopeId);
    }
    else {
      throw new RestException("Variable scope id '" + variableScopeId + "' does not match with variable instance '" + variableInstance + "'");
    }
  }
View Full Code Here

TOP

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

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.