CamJohnson26
CamJohnson26

Reputation: 1199

Mulesoft MEL Expression Get String Value Of Payload Data Type

I want to extract my payload's class name in a MUnit assert so I can verify the payload is always of the correct type. I've tried 2 MEL expressions, but both return null in the MEL expression evaluator. The funny thing is that if I remove the .name part of the expression then I see a key called "name" with the value that I need. Any ideas?

payload.class.name
message.dataType.type.name

Upvotes: 0

Views: 2125

Answers (1)

dlb
dlb

Reputation: 357

One way is: #[payload.getClass().getSimpleName()]

Upvotes: 2

Related Questions