Spring - createMessageCorrelation get an NullPointerException

Spring: 2.5.4
Camunda: 7.15

First of all, thanks for great product.
I’m new in Camunda and have created a process. The BPMN file I attach bellow
SCID.bpmn (32.0 KB)

I have an issue when trying to trigger task that name is IS Connector Callback.


Then it struck at here.
Spring Code:

this.runtimeService.createMessageCorrelation("receive_callback_from_is").processInstanceId("da19734c-436d-11ec-852b-b2a2cebc2b87").correlate();

The log I got:

org.camunda.bpm.engine.exception.NullValueException: execution da19734c-436d-11ec-852b-b2a2cebc2b87 doesn’t exist: execution is null

The above execution is already existed in Cockpit

I don’t know what exactly is going on for this behavior and how can I fix it?
Thanks for any help

Best,
Quan

1 Like

Hi @quannv,

I see that you run with a spring boot version that is not supported by your Camunda version. The compatibility matrix says, that you need a Camunda version higher than 7.15.3-ee to use Spring boot 2.5.4: Spring Boot Version Compatibility | docs.camunda.org

Regarding your question: Could you verify, that the process instance id you entered is the currect process instance?

It is better to use the values of process variables and/or the businessKey to correlate a message. It provides more flexibility than hard coded process instance ids.

Hope this helps, Ingo

Hi @Ingo_Richtsmeier
Thanks for your quick reply

For your question:

Could you verify, that the process instance id you entered is the currect process instance?

I’m sure that I entered the correct process instance. In my fact, my spring code is:

this.runtimeService.createMessageCorrelation(taskId).processInstanceId(processId).correlate();

Where, processId is collected when I kick off the workflow. My bad when thinking that hard coded is easy understanding

With your final suggested

It is better to use the values of process variables and/or the businessKey to correlate a message. It provides more flexibility than hard coded process instance ids.

I use call activity and then I don’t see anything that has value businessKey in Modeler and how can I generate one to trigger my activity receive_callback_from_is from Spring Code

Sorry when I don’t have much experience with Camunda :worried:

Thanks a lots

Quan

Hi @quannv,

A call activity will create a new process instance with a different id.

The Business key can be set at the start of a process instance or in a java delegate:

You can forward the business key to a called process in the modeler:

grafik

Hope this helps, Ingo

Many thanks, this issue is fixed :smiley: