user1912657
user1912657

Reputation: 189

MULE expression-transformer not accepted

I'm trying to learn Mule ESB but get problems with example projects. Why are these lines underlined red and not represented in the Message flow?

<expression-transformer name="returnAttachments">
        <return-argument evaluator="attachments-list" expression="*.txt,*.ozb,*.xml" optional="false"/>
    </expression-transformer>

I've cut and pasted these lines from mulesoft.org as part of a sample project.

Upvotes: 1

Views: 1191

Answers (2)

David Dossot
David Dossot

Reputation: 33413

@genjosanzo is right, the MEL equivalent would be:

<expression-transformer
        expression="#[($.value in message.inboundAttachments.entrySet() if $.key ~= '(.*\\.txt|.*\\.ozb|.*\\.xml)')]" />

Upvotes: 1

genjosanzo
genjosanzo

Reputation: 3264

Mule studio has problem rendering nested elements (bug reported here)

Instead you can use the compact version and replace it with the following:

<expression-transformer expression="#[attachments-list:*.txt,*.ozb,*.xml]"  doc:name="Expression" />

On a side note ever since mule 3.3.0 the new mule expression languages and it is recommended to rely on it whenever possible.

Upvotes: 1

Related Questions