I am wondering what is the recommended way of throwing a message event at a subprocess instance which is a subprocess of a multiinstance subprocess of a master process as illustrated by my attachment:
The master process has a variable called ID1 and the multiinstance subprocess instance has a local variable called ID2. How can I throw the message event to the proper execution, using method runtimeService.messageEventReceived(correlationMessage, execution.getId(), processVariables)? The “proper execution” would be one identified by a specific value of ID2.
Or should I rather use RuntimeService.correlateMessage(String messageName, Map<String,Object> correlationKeys, Map<String,Object> processVariables) method?
I have taken both approaches, but no luck. Any other suggestions, please?