Hello, I have the following case and can’t really understand what is the problem.
Create order task has async continuation Before and Exclusive.
Update order task has async continuation Before and Exclusive.
For the catch event, I want to have both before and after async, but if I also make it exclusive, I can’t correlate a message to it. I just get MismatchingMessageCorrelationException even if the process is for sure waiting for the event.
This happens in a Junit 5 test. If I remove the exclusive flag from the event, everything works fine, but if it is there, message correlation does not work.
What is really happening here? Is this a problem with the test library or my transaction handling is wrong?
In a JUnit test, with the job executor disabled, you can use execute(job()) to hop over the async continuation boundary: Assert Examples | docs.camunda.org
This could be async before on the next task as well. Technically, there is no difference (except you have some execution listeners on the sequence flow). When you do async after and async before on two consecutive tasks, it is (mostly) a waste of resources, as you need execute(job()) two times.
The process test coverage is a good tool to find out how your process instance progressed in the test.
With the information about wait states and async before on the next task is the same as async after on the current, I will just remove all explicit async handling on the catch event.