Using intermediate message throw event - access message key

From the execution you should be able to get the message name attribute using something like the following in your JavaDelegate:

 public void execute(DelegateExecution execution) throws Exception {
        ThrowEvent event = (IntermediateThrowEvent)execution.getBpmnModelElementInstance();
        event.getEventDefinitions().forEach(e->{
            System.out.println(((MessageEventDefinition)e).getMessage().getName());
        });
}

(Instance Model API for reference: https://docs.camunda.org/javadoc/camunda-bpm-platform/7.10/?org/camunda/bpm/model/bpmn/instance/package-summary.html)


nor do I know how I can map this generated message-key to the relevant message-name I need for identification.

Can you explain this part a bit more, not sure i understand.

1 Like