Examples of RESTException


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

        instance = formService.submitStartForm(processDefinitionId, variables);
      }

    } catch (ProcessEngineException e) {
      String errorMessage = String.format("Cannot instantiate process definition %s: %s", processDefinitionId, e.getMessage());
      throw new RestException(Status.INTERNAL_SERVER_ERROR, e, errorMessage);

    } catch (RestException e) {
      String errorMessage = String.format("Cannot instantiate process definition %s: %s", processDefinitionId, e.getMessage());
      throw new InvalidRequestException(e.getStatus(), e, errorMessage);
View Full Code Here

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

      byte[] processModel = IoUtil.readInputStream(processModelIn, "processModelBpmn20Xml");
      return ProcessDefinitionDiagramDto.create(processDefinitionId, new String(processModel, "UTF-8"));
    } catch (ProcessEngineException e) {
      throw new InvalidRequestException(Status.BAD_REQUEST, e, "No matching definition with id " + processDefinitionId);
    } catch (UnsupportedEncodingException e) {
      throw new RestException(Status.INTERNAL_SERVER_ERROR, e);
    } finally {
      IoUtil.closeSilently(processModelIn);
    }
  }
View Full Code Here

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

    } catch (NotValidException e) {
      throw new InvalidRequestException(Status.BAD_REQUEST, e, e.getMessage());

    } catch (ProcessEngineException e) {
      throw new RestException(Status.INTERNAL_SERVER_ERROR, e);

    }

    return CaseDefinitionDto.fromCaseDefinition(definition);
  }
View Full Code Here

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

    } catch (NotValidException e) {
      throw new InvalidRequestException(Status.BAD_REQUEST, e, e.getMessage());

    } catch (ProcessEngineException e) {
      throw new RestException(Status.INTERNAL_SERVER_ERROR, e);

    } catch (UnsupportedEncodingException e) {
      throw new RestException(Status.INTERNAL_SERVER_ERROR, e);

    } finally {
      IoUtil.closeSilently(caseModelInputStream);
    }
  }
View Full Code Here

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

      String errorMessage = String.format("Cannot instantiate case definition %s: %s", caseDefinitionId, e.getMessage());
      throw new InvalidRequestException(Status.FORBIDDEN, e, errorMessage);

    } catch (ProcessEngineException e) {
      String errorMessage = String.format("Cannot instantiate case definition %s: %s", caseDefinitionId, e.getMessage());
      throw new RestException(Status.INTERNAL_SERVER_ERROR, e, errorMessage);

    }

    CaseInstanceDto result = CaseInstanceDto.fromCaseInstance(instance);
View Full Code Here

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

    try {
      VariableMap variables = VariableValueDto.toMap(triggerDto.getVariables(), engine, objectMapper);
      runtimeService.messageEventReceived(messageName, executionId, variables);

    } catch (ProcessEngineException e) {
      throw new RestException(Status.INTERNAL_SERVER_ERROR, e, String.format("Cannot trigger message %s for execution %s: %s",
        messageName, executionId, e.getMessage()));

    } catch (RestException e) {
      String errorMessage = String.format("Cannot trigger message %s for execution %s: %s", messageName, executionId, e.getMessage());
      throw new InvalidRequestException(e.getStatus(), e, errorMessage);
View Full Code Here

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

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

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

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

Examples of org.eclipse.ecf.remoteservice.rest.RestException

    return os.toByteArray();
  }

  protected void handleException(String message, Throwable e, int responseCode, byte[] responseBody) throws RestException {
    logException(message, e);
    throw new RestException(message, e, responseCode, responseBody);
  }
View Full Code Here

Examples of org.geomajas.rest.server.RestException

    List<InternalFeature> features;
    try {
      features = vectorLayerService.getFeatures(layerId, null, filterService
          .createFidFilter(new String[] { featureId }), null, getIncludes(noGeom));
    } catch (GeomajasException e) {
      throw new RestException(e, RestException.PROBLEM_READING_LAYERSERVICE, layerId);
    }
    if (features.size() != 1) {
      throw new RestException(RestException.FEATURE_NOT_FOUND, featureId, layerId);
    }
    model.addAttribute(FEATURE_COLLECTION, features.get(0));
    model.addAttribute(VECTOR_LAYER_INFO, features.get(0).getLayer().getLayerInfo());
    model.addAttribute(ATTRIBUTES, attrs);
    return VIEW;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.