0
votes

I am trying to compare a java object value in mule expression as below,

#[message.EventHandlerMessage.eventId == 'SEND_NOTIFICATION']

The above expression fails with Execution of the expression "message.EventHandlerMessage.eventId == 'SEND_IMEX'" failed. (org.mule.api.expression.ExpressionRuntimeException). Message payload is of type: EventHandlerMessage (org.mule.api.MessagingException)

java object content with Logger component

LoggerMessageProcessor- INFO - - - message="EventHandlerMessage [refId=10002, eventId=SEND_NOTIFICATION, eventRefNo=10000000001212]"

how do i compare the eventid in Eventhandler message with mule expression?

2
I'm confused about that log. Is that logging the payload? Can you try #[payload.message.eventId]?Avanaur
Are you trying to compare in a choice component?Satheesh Kumar

2 Answers

0
votes

Why your error is showing "message.EventHandlerMessage.eventId == 'SEND_IMEX'" when your comparing like #[message.EventHandlerMessage.eventId == 'SEND_NOTIFICATION'].

Before trying to compare, try to print the value using MEL and see if it is printing then you can compare.

0
votes

There will be no property message.EventHandlerMessage on the message context. Here are the properties you can access on message: http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/el/context/MessageContext.html

If your payload is an instance of EventHandlerMessage.class try using this instead:

#[message.payload.eventId]