use of org.camunda.bpm.engine.exception.NotValidException in project camunda-bpm-platform by camunda.
the class DecisionRequirementsDefinitionResourceImpl method getDecisionRequirementsDefinition.
@Override
public DecisionRequirementsDefinitionDto getDecisionRequirementsDefinition() {
RepositoryService repositoryService = engine.getRepositoryService();
DecisionRequirementsDefinition definition = null;
try {
definition = repositoryService.getDecisionRequirementsDefinition(decisionRequirementsDefinitionId);
} catch (NotFoundException e) {
throw new InvalidRequestException(Status.NOT_FOUND, e, e.getMessage());
} catch (NotValidException e) {
throw new InvalidRequestException(Status.BAD_REQUEST, e, e.getMessage());
} catch (ProcessEngineException e) {
throw new RestException(Status.INTERNAL_SERVER_ERROR, e);
}
return DecisionRequirementsDefinitionDto.fromDecisionRequirementsDefinition(definition);
}
use of org.camunda.bpm.engine.exception.NotValidException in project camunda-bpm-platform by camunda.
the class DecisionRequirementsDefinitionResourceImpl method getDecisionRequirementsDefinitionDmnXml.
@Override
public DecisionRequirementsDefinitionXmlDto getDecisionRequirementsDefinitionDmnXml() {
InputStream decisionRequirementsModelInputStream = null;
try {
decisionRequirementsModelInputStream = engine.getRepositoryService().getDecisionRequirementsModel(decisionRequirementsDefinitionId);
byte[] decisionRequirementsModel = IoUtil.readInputStream(decisionRequirementsModelInputStream, "decisionRequirementsModelDmnXml");
return DecisionRequirementsDefinitionXmlDto.create(decisionRequirementsDefinitionId, new String(decisionRequirementsModel, "UTF-8"));
} catch (NotFoundException e) {
throw new InvalidRequestException(Status.NOT_FOUND, e, e.getMessage());
} 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(decisionRequirementsModelInputStream);
}
}
use of org.camunda.bpm.engine.exception.NotValidException in project camunda-bpm-platform by camunda.
the class DecisionDefinitionResourceImpl method getDecisionDefinitionDmnXml.
@Override
public DecisionDefinitionDiagramDto getDecisionDefinitionDmnXml() {
InputStream decisionModelInputStream = null;
try {
decisionModelInputStream = engine.getRepositoryService().getDecisionModel(decisionDefinitionId);
byte[] decisionModel = IoUtil.readInputStream(decisionModelInputStream, "decisionModelDmnXml");
return DecisionDefinitionDiagramDto.create(decisionDefinitionId, new String(decisionModel, "UTF-8"));
} catch (NotFoundException e) {
throw new InvalidRequestException(Status.NOT_FOUND, e, e.getMessage());
} 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(decisionModelInputStream);
}
}
use of org.camunda.bpm.engine.exception.NotValidException in project camunda-bpm-platform by camunda.
the class CaseExecutionResourceImpl method reenable.
public void reenable(CaseExecutionTriggerDto triggerDto) {
try {
CaseService caseService = engine.getCaseService();
CaseExecutionCommandBuilder commandBuilder = caseService.withCaseExecution(caseExecutionId);
initializeCommand(commandBuilder, triggerDto, "reenable");
commandBuilder.reenable();
} catch (NotFoundException e) {
throw createInvalidRequestException("reenable", Status.NOT_FOUND, e);
} catch (NotValidException e) {
throw createInvalidRequestException("reenable", Status.BAD_REQUEST, e);
} catch (NotAllowedException e) {
throw createInvalidRequestException("reenable", Status.FORBIDDEN, e);
} catch (ProcessEngineException e) {
throw createRestException("reenable", Status.INTERNAL_SERVER_ERROR, e);
}
}
use of org.camunda.bpm.engine.exception.NotValidException in project camunda-bpm-platform by camunda.
the class CaseExecutionResourceImpl method disable.
public void disable(CaseExecutionTriggerDto triggerDto) {
try {
CaseService caseService = engine.getCaseService();
CaseExecutionCommandBuilder commandBuilder = caseService.withCaseExecution(caseExecutionId);
initializeCommand(commandBuilder, triggerDto, "disable");
commandBuilder.disable();
} catch (NotFoundException e) {
throw createInvalidRequestException("disable", Status.NOT_FOUND, e);
} catch (NotValidException e) {
throw createInvalidRequestException("disable", Status.BAD_REQUEST, e);
} catch (NotAllowedException e) {
throw createInvalidRequestException("disable", Status.FORBIDDEN, e);
} catch (ProcessEngineException e) {
throw createRestException("disable", Status.INTERNAL_SERVER_ERROR, e);
}
}
Aggregations