I had problems with this too, I will use this tip :]
Evals really suck. I tried to load simples rules with eval, and I couldn't get
past 3000 rules. Without evals I loaded 15000.
On Monday 02 July 2007 18:00, Edson Tirelli wrote:
Eval's are indeed less performatic than any other type of
constraints.
"inline-evals" are not as bad, but are also heavier than regular
constraints.
The recommendation is to avoid when possible, but for some cases it is
not possible.
If you are using MR3 or later, you can use MVELs syntax in your
constraints:
when
MyClass( aMapAttribute['aKey'] == "some Value" )
then
...
end
The above will transparently be translated to an inline-eval, but that
is the best you can do when working with maps.
[]s
Edson
2007/7/2, Rajesh_Kumar <Rajesh_Kumar(a)rsystems.com>:
> Hi all,
>
> I want to use "eval" in my rules, but in rule writing guidelines Mark
> has
> Written that "Eval is Evil".
>
> I want to compare the values of Hash Map in my when (conditions) part.
>
> 1) Will anyone suggest something so that I can compare Hash Map keys in
> when part?
>
> 2) Does is there any performance related issue related to "eval";
>
> Regards
>
> Rajesh
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/rules-users