The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

dvorme (14) [Avatar] Offline
#1
"Give a man a fish and he'll eat for a day / teach a man to fish..."

Alert: Frustrated newbie questions. I'm trying to be respectful and constructive, but some of the frustration may come through as well. If so, then I request that you please kindly bear with me.

I found chapter 5 useful for understanding the /kinds of/ things I can do using routing. However, I'm confused about how to know what objects/properties are available to me when using the Mule Expression Language in different contexts.

The links in the appendix referred me to:

http://mvel.codehaus.org/

which tells me about the syntax of the language, but doesn't answer my question about how it is integrated into Mule.

Same with:

http://www.mulesoft.org/documentation/display/current/Introduction+to+Expressions+in+Mule


Here are a few specific questions:

How do I figure out what objects are available in a given MEL context (I presume that different contexts may have different objects available)?

Similarly: What are Mule's rules for evaluating truth / falsehood in an expression? Is it strictly true/false as a boolean? Or does it follow a more scripting language-like semantic where false, null, all flavors of zero, empty strings, and empty collections are false and anything else is true?

Similarly: When can I use XPath? On XML documents only or on Java object graphs also? Or is this a part of MEL and I should just go RTFM on MEL's web site?

More generally, where can I find documentation (or better yet, can you explain in the book) the rules Mulesoft used when integrating MVEL into Mule as MEL?

Very specifically, Eclipse's P2 query API documentation contains an example of the sort of documentation I'm looking for at:

http://wiki.eclipse.org/Equinox/p2/Query_Language_for_p2#How_the_language_integrates_with_Java_objects


Thanks in advance,

Dave Orme
dvorme (14) [Avatar] Offline
#2
Re: MEL integration questions
After much searching, I stumbled across:

www.mulesoft.org/documentation/display/current/Mule+Expression+Language+MEL

which seems to contain the answers to most of my questions in the section titled "MEL Context Objects and Functions".

I suggest having a section in the book that summarizes this section and then links to the page for detail.


Thanks,

Dave Orme
David Dossot (233) [Avatar] Offline
#3
Re: MEL integration questions
Appendix A covers this in detail.
dvorme (14) [Avatar] Offline
#4
Re: MEL integration questions
OK, I see it now in A.1.1.1.

I suggest calling this information out using bullets to make it more obvious. I missed it when reading it earlier.


Thanks,

Dave
dvorme (14) [Avatar] Offline
#5
Re: MEL integration questions
Actually, I might even suggest an info box to call out this information as this is perhaps the most important information in the whole appendix as it represents the root of everything you can access in MEL.

Regards,

Dave
David Dossot (233) [Avatar] Offline
#6
Re: MEL integration questions
I like this suggestion, thank you.

A box with just the names of the root variables will be enough, right? Can't really detail too much in there.
dvorme (14) [Avatar] Offline
#7
Re: MEL integration questions
Yes; that would be beautiful; thanks.

Dave
James Fort (1) [Avatar] Offline
#8
Re: MEL integration questions
I'm piggybacking here but I searched for examples of passing multiple parameters as Method Arguments from i.e. an http protocol component using MEL syntax.
David Dossot (233) [Avatar] Offline
#9
Re: MEL integration questions
Hi James,

Sorry, I don't really understand what you are trying to achieve. Do you have a sample flow?