use of org.camunda.bpm.engine.exception.NotValidException in project camunda-bpm-platform by camunda.
the class HistoricTaskInstanceTest method testQueryByInvalidTaskDefinitionKeys.
public void testQueryByInvalidTaskDefinitionKeys() {
HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery();
query.taskDefinitionKeyIn("invalid");
assertEquals(0, query.count());
try {
query.taskDefinitionKeyIn(null);
fail("A ProcessEngineExcpetion was expected.");
} catch (NotValidException e) {
}
try {
query.taskDefinitionKeyIn((String) null);
fail("A ProcessEngineExcpetion was expected.");
} catch (NotValidException e) {
}
try {
String[] values = { "a", null, "b" };
query.taskDefinitionKeyIn(values);
fail("A ProcessEngineExcpetion was expected.");
} catch (NotValidException e) {
}
}
use of org.camunda.bpm.engine.exception.NotValidException in project camunda-bpm-platform by camunda.
the class HistoricProcessInstanceDurationReportTest method testReportByInvalidStartedBefore.
public void testReportByInvalidStartedBefore() {
HistoricProcessInstanceReport report = historyService.createHistoricProcessInstanceReport();
try {
report.startedBefore(null);
fail();
} catch (NotValidException e) {
}
}
use of org.camunda.bpm.engine.exception.NotValidException in project camunda-bpm-platform by camunda.
the class HistoricProcessInstanceDurationReportTest method testReportByInvalidStartedAfter.
public void testReportByInvalidStartedAfter() {
HistoricProcessInstanceReport report = historyService.createHistoricProcessInstanceReport();
try {
report.startedAfter(null);
fail();
} catch (NotValidException e) {
}
}
use of org.camunda.bpm.engine.exception.NotValidException in project camunda-bpm-platform by camunda.
the class AbstractReportDto method executeReport.
public List<? extends ReportResult> executeReport(ProcessEngine engine) {
T reportQuery = createNewReportQuery(engine);
applyFilters(reportQuery);
try {
return executeReportQuery(reportQuery);
} catch (NotValidException e) {
throw new InvalidRequestException(Status.BAD_REQUEST, e, e.getMessage());
}
}
use of org.camunda.bpm.engine.exception.NotValidException in project camunda-bpm-platform by camunda.
the class CaseDefinitionResourceImpl method getCaseDefinitionCmmnXml.
@Override
public CaseDefinitionDiagramDto getCaseDefinitionCmmnXml() {
InputStream caseModelInputStream = null;
try {
caseModelInputStream = engine.getRepositoryService().getCaseModel(caseDefinitionId);
byte[] caseModel = IoUtil.readInputStream(caseModelInputStream, "caseModelCmmnXml");
return CaseDefinitionDiagramDto.create(caseDefinitionId, new String(caseModel, "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(caseModelInputStream);
}
}
Aggregations