I am using the message boundary event to catch the message.
but it is not updating the process variables with the new one that I am sending.
So I will provide what configuration I am using.
log.info(“var Map :- {}”,varMap); zeebeClient.newPublishMessageCommand().messageName(“DormancyActivation”).correlationKey(correlationKey)
.variables(varMap)
.send()
.join();
here the varmap is having the updated ones in the list so tell me the process how to fix this issue and configure it properly.
If I am using the message task it is updating the values for this boundary event it is not happening.
This is a common issue with message boundary events in Camunda 8. The problem is likely related to how variables are handled differently between message tasks and message boundary events.
Root Cause Analysis
When you send a message using publishMessageCommand(), the variables should be merged into the process instance’s global scope by default. However, there are several potential causes why this might not be working:
1. Check Your BPMN Configuration
The most common cause is output mappings configured on the message boundary event. If you have output mappings defined, only the explicitly mapped variables will be updated in the process instance.
Solution:
Open your BPMN model in Camunda Modeler
Select the message boundary event
In the Properties Panel, check the Variable Mappings section
If you want ALL message variables to be merged into the process: remove any output mappings
If you want specific mappings: configure them explicitly (e.g., map sourceVar to targetVar)
2. Variable Scope Considerations
Message boundary events merge variables into the global process scope, not into local variables of the attached activity. This is different from message tasks.
3. Verify Your Code
Your code looks correct, but double-check that you’re using .variables(varMap) and not .payload():
Check the BPMN model: Look at the message boundary event’s variable mappings
Verify variable scope: Use Operate to check if variables appear in the global process scope
Compare with working message task: Check if the message task has different variable mapping configuration
Quick Fix
Try removing any output mappings from your message boundary event in the BPMN model. This should allow all variables from varMap to be merged into the process instance.
Could you please share:
The variable mapping configuration of your message boundary event (screenshot from Camunda Modeler would be helpful)
Whether you can see the variables in Operate after the message is received