Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9116435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:40:19+00:00 2026-06-17T04:40:19+00:00

In my Mule flow I want to use a ternary operation in a message

  • 0

In my Mule flow I want to use a ternary operation in a message enrichment element.

For example, here is the existing line that throws an error when the source is null:


        <enricher doc:name="Add revision number" target="#[variable:rev]" source="#[json:_rev]">

Here is the line when trying to use the ternary operation:


        <enricher doc:name="Add revision number" target="#[variable:rev]" source="#[json:_rev == null ? '' : json:_rev]">

If a null is returned from the enrichment source, I want to return an empty string instead. I don’t want errors to be thrown when Mule tries to use the ‘setProperty()’ function to assign a null value.

Currently the ternary example works, but it returns ‘false’ (not as a string).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T04:40:20+00:00Added an answer on June 17, 2026 at 4:40 am

    This is not the Mule Expression Language (MEL) but the old evaluator syntax, which doesn’t support ternary expressions.

    EDIT:

    I suggest your get the MEL cheatsheet and see how JSON handling is done.

    From the partial information you provide, I think you’ll need a json-to-object-transformer in the response phase of your HTTP outbound endpoint (that fetches JSON right?). Then you can use a MEL ternary expression in your enricher.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to publish my WSDL in MULE and use these codes: <flow name=cxfProxy>
Using Mule 3.2.1, I want to pass a Mule Message or Mule Event to
How do I write a Mule flow to use a Quartz Scheduler to read
In the following mule flow I'm using xpath to decide which queue the message
I have a Mule 3.3 project that uses Maven. I want the Mule Maven
I'm trying to implement error handling logic in my Mule flow and I want
I need to use a spring bean in 2 places in my mule flow.
How can I pass parameters to external webservice via mule flow using CFX?
Mule has many endpoints, components, etc. for example like http:rest-service-component. How do I know
I have a Mule 3.3.0 flow which splits a file into records. I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.