Setting up message throw event with in the subprocess and catch event on call activity

The process scenario is such that:

  1. From parent process, a call to subprocess has message boundary catch event with message name ‘A’
  2. From with in the subprocess , the message ‘A’ is thrown via message event.
  3. At throw event following code is used at execution listener to correlate the message based on corelation variables.
    runtimeService.createMessageCorrelation(‘A’)
    .processInstanceVariableEquals(“id”, execution.getVariable(“id”))
    .correlate()

It is ending up at the error ‘TASK/CLIENT-01009 Exception while completing the external task: null’
What is missing ?

You’re trying to correlate to a boundary event on the same subprocess

  • The message boundary event is attached to the subprocess, and you are trying to catch the message from inside that same subprocess.
  • Camunda design limitation: A subprocess cannot catch a message that is thrown from within itself. The boundary event expects an external trigger.

:bulb: Message boundary events must be triggered externally, not internally from the same scope. That’s why the correlation fails.

What Can You Do?

:white_check_mark: Move the Throw Outside the Subprocess

Trigger the message from the parent process or from an external system, not from inside the subprocess.

If you want the message to be sent based on something happening inside the subprocess, you could:

  • Use a signal event instead if you want broadcast-like behavior.
  • Or use an intermediate message throw event to exit the subprocess, then correlate the boundary message from outside.
1 Like

Thank you !

This isn’t a design limitation - it’s actually part of the specification. A process cannot send a message to itself.

1 Like

Thanks for the clarification! That makes sense. I was under the impression it might be a design limitation rather than part of the spec.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.