You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Nikhil G. Daddikar" <ng...@celoxis.com> on 2009/06/06 08:36:33 UTC
JEXL: status and questions
Hi Folks,
We have a concept of custom fields on our classes and we are thinking of
introducing a 'Formula' field and hence the interest in JEXL. I have a
few questions:
1. Does JEXL have any future or should I look at Commons EL?
2. What is the "return value" of a script? For example, if I evaluate
"a=task.id;b=task.Name; task.Name;" the result is task.id which is an
integer, I don't understand the logic.
3. Is there a "return" in JEXL?
4. On the syntax page it says for Scripts : Scripts can be read from a
String, File or URL. Can anyone elaborate?
Thanks
Nikhil
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: JEXL: status and questions
Posted by Henrib <hb...@gmail.com>.
Howdy,
Nikhil G. Daddikar wrote:
>
> 1. Does JEXL have any future or should I look at Commons EL?
>
The project is in use in multiple places but it hasn't been updated for a
long time.
I'm pushing to restart the 2.0 effort & we will see soon if this gets some
traction.
Nikhil G. Daddikar wrote:
>
> 2. What is the "return value" of a script? For example, if I evaluate
> "a=task.id;b=task.Name; task.Name;" the result is task.id which is an
> integer, I don't understand the logic.
>
Could be an RFE; I suspect that creating a block will do what you expect:
"{a=task.id;b=task.Name; task.Name;}"
Nikhil G. Daddikar wrote:
>
> 3. Is there a "return" in JEXL?
>
No. Could be an RFE since it makes sense to break/exit loops with a given
value. However, the idea of JEXL is a simple expression evaluator, not a
full fledge language. Using Javascript (aka Rhino) might be another option.
Nikhil G. Daddikar wrote:
>
> 4. On the syntax page it says for Scripts : Scripts can be read from a
> String, File or URL. Can anyone elaborate?
>
In API terms, you can create a script in Java from:
- a String variable using it as the script source.
- an URL (like "http://...") fetching the content and using it as a script
source.
- a File (like "/tmp/myscript.jexl") from your file-system using its content
as the script source.
Hope this helps.
Cheers
Henri
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
--
View this message in context: http://www.nabble.com/JEXL%3A-status-and-questions-tp23899160p23902130.html
Sent from the Commons - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org