I’ve tried to get intermediate message catch events working. I’m trying to trigger the correct execution based on some correlation key I have.
The documentation on messages states that this query should work:
Execution execution = runtimeService.createExecutionQuery() .messageEventSubscriptionName("paymentReceived") .variableValueEquals("orderId", message.getOrderId()) .singleResult();
However, I find that this query does always result in an empty set. I added a workaround in my code which does two queries, one for the Process Instance where I do the correlation, and another one for the execution where I use the PI as a parent along the message name.
Am I missing something or is this expected behaviour?