use of org.camunda.bpm.engine.MismatchingMessageCorrelationException in project camunda-bpm-platform by camunda.
the class ReceiveTaskTest method testNotSupportsCorrelateMessageOnParallelMultiReceiveTask.
@Deployment(resources = "org/camunda/bpm/engine/test/bpmn/receivetask/ReceiveTaskTest.multiParallelReceiveTask.bpmn20.xml")
public void testNotSupportsCorrelateMessageOnParallelMultiReceiveTask() {
// given: a process instance waiting in two receive tasks
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("testProcess");
// expect: there are two message event subscriptions
List<EventSubscription> subscriptions = getEventSubscriptionList();
assertEquals(2, subscriptions.size());
// then: we can not correlate an event
try {
runtimeService.correlateMessage(subscriptions.get(0).getEventName());
fail("should throw a mismatch");
} catch (MismatchingMessageCorrelationException e) {
// expected
}
}
use of org.camunda.bpm.engine.MismatchingMessageCorrelationException in project camunda-bpm-platform by camunda.
the class MessageCorrelationTest method testFailCorrelateMessageStartEventWithWrongProcessDefinitionId.
@Test
public void testFailCorrelateMessageStartEventWithWrongProcessDefinitionId() {
testRule.deploy(Bpmn.createExecutableProcess("process").startEvent().message("a").userTask().endEvent().done());
testRule.deploy(Bpmn.createExecutableProcess("process").startEvent().message("b").userTask().endEvent().done());
ProcessDefinition latestProcessDefinition = repositoryService.createProcessDefinitionQuery().latestVersion().singleResult();
try {
runtimeService.createMessageCorrelation("a").processDefinitionId(latestProcessDefinition.getId()).correlateStartMessage();
fail("expected exception");
} catch (MismatchingMessageCorrelationException e) {
testRule.assertTextPresent("Cannot correlate message 'a'", e.getMessage());
}
}
Aggregations