Intermediate Message Event not working

Hi

I have modeled an Main process with single activity and Event sub process (child process) with intermediate message event receiving message.

I am able to kick-start the process instance, but could not trigger intermediate message event inside the event sub-process. I am using below Java API to trigger the message. First I am trying to query execution object using createExecutionQuery() [But it returns null always] and invoking message on intermediate message event, using runtimeService,messasgeEventReceived(eventMessageName, executionID);
Execution execution = runtimeService.createExecutionQuery()
.processInstanceId(processInstanceID)
.messageEventSubscriptionName(“childMessageEventRef”)
.singleResult();
if (execution != null) {
System.out.println("Execution ID ::: " + execution.getId());
runtimeService.messageEventReceived(“childMessageEventRef”, execution.getId());
}

Please can you help achieve this functionality.

Process Diagram

IntermediateMessageEvent.bpmn20.xml

<?xml version="1.0" encoding="UTF-8"?>

Thanks

Hi,

You can’t use an intermediate catch event as the starting point for an event sub process. Instead, use a message start event and then it should work as expected.

Best regards,

Tijs

Thanks tijs.

I have changed to start message event and It is working as expected now.

hello there
just want to know that whether messageEventSubscriptionName is the same thing as the messageRef?

No need to crosspost (Finding executions waiting for messages based on process variable matches - #7 by joram)