You will have to register math as name space with JexlContext

https://commons.apache.org/proper/commons-jexl/apidocs/org/apache/commons/jexl3/package-summary.html

Regards,
Swapnil

On Sun, Apr 19, 2020 at 10:51 AM Greenberg, Gary <ggree...@visa.com.invalid>
wrote:

> I am trying to evaluate an expression that beside simple arithmetic need
> to calculate square root.
>
> I tried sqrt(), Math.sqrt() and java.lang.Math.sqrt and nothing works
>
> I am always getting something like @1:1 undefined variable java.lang.Math.
>
> I did use before expr4j and it has all these functions built-in.
>
> Switched to JEXL, because need not only numeric, but also Boolean
> expressions.
>
> Can you also confirm if this type of expressions will work:
>
>                 a.equalsIgnoreCase(“XYZ”) && b.startWith(“http”)
>
> where a and b are variables in the JexlContext.
>
>
>
> Gary Greenberg
>
> Staff Software Engineer
>
> Data Product Development, BI-A
>
> E: ggree...@visa.com
>
> M: 650-269-7902
>
>
>
> [image: EmailSig-TaglineVersion]
>
>
>

Reply via email to