commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zoran <>
Subject [OGNL] more complex expressions
Date Tue, 22 Dec 2015 12:32:33 GMT
I have been using OGNL as a simple expression processing engine where we can
dynamically set an expression to something like Q25==15?100:0  which works
out a simple if else expression from a map containing keyed integer values.

Now I would like to extend it to use more complex conditional testing with
if() else if() else if() etc. Where my issue is I¹m not sure how to return
the final value. For example how would I write:

If(Q25+Q26+Q27 > 31) return 50 else if(Q25+Q26+Q27 > 21) return 100 else
if(Q25+Q26+Q27 > 11) return 200

Thanks in advance.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message