use of org.camunda.bpm.engine.exception.NotValidException in project camunda-bpm-platform by camunda.
the class ProcessInstanceModificationAsyncTest method testCancelTransitionInstanceTwiceFails.
/**
* CAM-4090
*/
@Deployment(resources = NESTED_ASYNC_BEFORE_TASK_PROCESS)
public void testCancelTransitionInstanceTwiceFails() {
// given there are two transition instances in an inner scope
// and an active activity instance in an outer scope
ProcessInstance instance = runtimeService.createProcessInstanceByKey("nestedOneTaskProcess").startBeforeActivity("innerTask").startBeforeActivity("innerTask").execute();
ActivityInstance tree = runtimeService.getActivityInstance(instance.getId());
// when i cancel both transition instances
TransitionInstance[] transitionInstances = tree.getTransitionInstances("innerTask");
// this test ensures that the replacedBy link of executions is not followed
// in case the original execution was actually removed/cancelled
String transitionInstanceId = transitionInstances[0].getId();
try {
runtimeService.createProcessInstanceModification(instance.getId()).cancelTransitionInstance(transitionInstanceId).cancelTransitionInstance(transitionInstanceId).execute();
fail("should not be possible to cancel the first instance twice");
} catch (NotValidException e) {
assertTextPresentIgnoreCase("Cannot perform instruction: Cancel transition instance '" + transitionInstanceId + "'; Transition instance '" + transitionInstanceId + "' does not exist: transitionInstance is null", e.getMessage());
}
}
use of org.camunda.bpm.engine.exception.NotValidException in project camunda-bpm-platform by camunda.
the class CaseInstanceQueryTest method testQueryByInvalidCaseDefinitionKey.
public void testQueryByInvalidCaseDefinitionKey() {
CaseInstanceQuery query = caseService.createCaseInstanceQuery();
query.caseDefinitionKey("invalid");
verifyQueryResults(query, 0);
try {
query.caseDefinitionKey(null);
fail();
} catch (NotValidException e) {
}
}
use of org.camunda.bpm.engine.exception.NotValidException in project camunda-bpm-platform by camunda.
the class CaseInstanceQueryTest method testQueryByInvalidCaseInstanceBusinessKey.
public void testQueryByInvalidCaseInstanceBusinessKey() {
CaseInstanceQuery query = caseService.createCaseInstanceQuery();
query.caseInstanceBusinessKey("invalid");
verifyQueryResults(query, 0);
try {
query.caseInstanceBusinessKey(null);
fail();
} catch (NotValidException e) {
}
}
use of org.camunda.bpm.engine.exception.NotValidException in project camunda-bpm-platform by camunda.
the class CaseInstanceQueryTest method testQueryByInvalidCaseInstanceId.
public void testQueryByInvalidCaseInstanceId() {
CaseInstanceQuery query = caseService.createCaseInstanceQuery();
query.caseInstanceId("invalid");
verifyQueryResults(query, 0);
try {
query.caseInstanceId(null);
fail();
} catch (NotValidException e) {
}
}
use of org.camunda.bpm.engine.exception.NotValidException in project camunda-bpm-platform by camunda.
the class CaseInstanceQueryTest method testQueryByInvalidDeploymentId.
public void testQueryByInvalidDeploymentId() {
CaseInstanceQuery query = caseService.createCaseInstanceQuery().deploymentId("invalid");
verifyQueryResults(query, 0);
try {
query.deploymentId(null);
fail();
} catch (NotValidException e) {
// expected
}
}
Aggregations