Reputation: 3336
We are using Spring boot Camunda integration.
And I have bpmn process in camunda modedeler which looks like this:
It works as expected but once I tick "Asynchronous After" on "Receive offer" task
I start to get error on "Attempted signing" message correlation:
Cannot correlate message 'attemptedSigningMessage': No process definition or execution matches the parameters
It doesn't look like unlucky timing or any of the such problems. I tried to wait after completion of receive task for up to 10 seconds, it seems enough to come to the wait state on "Attempted signing", it more looks like that the process just stopped on synchronization after "Receive offer" task and waits for something. I checked that by such code:
historyService.createHistoricActivityInstanceQuery().finished().list()
It is important for me to have "Asynchronous After" after the receive task, to save the state of message receiving.
Please help how it can be accomplished with "Receive task"?
Thank you.
Upvotes: 2
Views: 2156
Reputation: 7583
This is a race condition. Confirm that the async job has completed and the token has surely arrived at "Attempted signing" when you are sending the message.
How are you testing this? Are you using a unit test?
If yes, are you moving the job forward using
execute(job());
before attempting the correlation? In a unit test the job executor is turned off by default, so you can test transaction boundaries. So the process will not automatically move forward after an async continuation. You have to move the job forward explicitly so the token moves to the next wait state (the message receive event here). Also see: https://github.com/camunda/camunda-bpm-assert/blob/master/docs/User_Guide_BPMN.md#helpers-execute
If no, I recommend to write one, so you can test the model.
Have you maybe set additional async continuations between "Receive offer' and "Attempted signing"?
If none of this helps, can you isolate the behavior and share the model?
Upvotes: 1