11119
October 28, 2020, 4:27pm
1
Hello there! Sorry I’m new with Camunda.
I have the simple bpmn which contains smth like this:
<bpmn:intermediateCatchEvent id=“Event_0t7h02h”>
<bpmn:incoming Flow_0udnzaw</bpmn:incoming>
<bpmn:outgoing Flow_1l5ns6u</bpmn:outgoing>
<bpmn:messageEventDefinition id=“MessageEventDefinition_1sqjb5r” messageRef=“Message_0conihf” />
</bpmn:intermediateCatchEvent>
…
<bpmn:message id=“Message_0conihf” name=“COMPLETE” />
Then I try to send message for concrete started instance of business process with businessKey=12345 like:
String businessKey = “12345”;
runtimeService.createMessageCorrelation(“COMPLETE” )
.processInstanceBusinessKey(businessKey)
.correlate();
And then I getting the exception:
Cannot correlate message ‘COMPLETE’: No process definition or execution matches the parameters
I just want to send message to business process to go to next camunda step. What did I do wrong?
Niall
October 28, 2020, 7:40pm
2
can you upload your model and also show exactly how you start the process?
11119
October 29, 2020, 4:00am
3
TestProcess1.bpmn (3.6 KB)
And then I start the process like:
public void deployBpmnProcess(String resourceName, String bpmnContent) {
repositoryService
.createDeployment()
.name(resourceName)
.addString(resourceName, bpmnContent)
.deploy();
}
deployBpmnProcess(businessProcessDto.getResourceName(),
businessProcessDto.getBpmnContent());
ProcessInstance process = runtimeService.startProcessInstanceByKey(businessProcessDto.getBusinessProcessDefinition(),
businessKey, businessProcessDto.getVariables());
Maybe important info is I sending correlate() from TestCamundaApiDelegate
11119
October 29, 2020, 6:20am
4
Solved: the message can’t be correlated because the receive task is not entered yet. Should correlate the message asynchronously using the async API call or an async-marker at the activity.