Hi @StephanHaarmann ,
Thanks for sharing your response on usage of correlation of a message.
Here in the following steps, I will try to explain, the order of flow being followed which is resulting into the above error situation.
-
start the workflow, from the start event(id: StartEvent_1
), which results in generation of a following journey response. here batchUuid acts as business key
-
the following scenario occurs, where workflow is waiting for a message, as shown here
-
Further, I try to place a message using a application-rest-api using runtimeService
@Autowired
private ProcessEngine camunda;
@PostMapping(value = "camunda/correlate-message/{msg}/{businessKey}")
public void testCamundaCorrelateMessage(@PathVariable("msg") final String msg,
@PathVariable("businessKey") final String businessKey) throws Exception {
camunda.getRuntimeService().createMessageCorrelation(msg)
.processInstanceBusinessKey(businessKey)
.setVariable("order_id", "1234ABCD")
.correlate();
}
- at this moment is when I encounter the following error
ERROR 2022-09-20 20:41:04.071 [-7083-exec-3] org.camunda.bpm.engine.context.logError:160 : ENGINE-16004 Exception while closing command context: Cannot correlate message 'MSG1': No process definition or execution matches the parameters
org.camunda.bpm.engine.MismatchingMessageCorrelationException: Cannot correlate message 'MSG1': No process definition or execution matches the parameters
at org.camunda.bpm.engine.impl.cmd.CorrelateMessageCmd.execute(CorrelateMessageCmd.java:88)
at org.camunda.bpm.engine.impl.cmd.CorrelateMessageCmd.execute(CorrelateMessageCmd.java:42)
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:28)
Sorry for such a long post.
As needed, I relaying a message for a process instance by passing the corresponding message key and businesskey, which is resulting into an erroneous situation for me.
I have newbie in camunda-workflow.
would be able to help, in identifying the missing understanding here, as I trying to consume a message.
Actual background: The requirement is that, an external microservice will be making callback to our application, written with the help of camunda. But for a single-process-instance, it can consume multiple callbacks, since we are creating multiple journeys. To handle such a scenario. An application rest-api will be exposed for callback, which inturn will post a message using runtimeService(), Initially, started working out by consuming single message, and performing certain processing, but eventually I would have to a scenario, where for a single businessKey, multiple messages need to be consumed and processed. Hope you understood the flow.
As a learning camunda-java-developer, would you suggest any patterns to be followed in above kind of scenarios.
Any suggestion will be valuable to our team.
Thanks
Srinish