cancel
Showing results for 
Search instead for 
Did you mean: 

How to extract payload from Message Intermediate Catch Event

araghuraman
Champ in-the-making
Champ in-the-making
Hi,

I have a workflow which contains a Message Intermediate Catch Event followed by a Java Service Task.
How can I extract the message payload from the Message Intermediate Catch Event from inside the Java Service Task?
2 REPLIES 2

jbarrez
Star Contributor
Star Contributor
How is the message passed? If the payload is a map, all the content is persisted as variables and you can access those in the service task:

  if (payload instanceof Map) {
     @SuppressWarnings("unchecked")
      Map<String, Object> processVariables = (Map<String, Object>) payload;
      execution.setVariables(processVariables);
    }

(from the AbstractEventHandler class)

araghuraman
Champ in-the-making
Champ in-the-making
Thanks! I will try it out