[rules-users] Replacement for eval
Nirmal Fernando
nirmal070125 at gmail.com
Tue Nov 16 06:37:31 EST 2010
Hi,
I have two questions.
1) Is there any other way/method in Drools to test the truth value of a
condition other than "eval"?
In almost all rules of my application needs to test conditions, and it takes
ages to run using "eval".
2) Say I have a java method which returns a boolean, and I have used it
within an "eval" function. (eg: eval(message.emptyMessageFinder()) )
This "emptyMessageFinder()" method will return a "boolean" if there's an
empty message. This function is containing many loops and recursive
operations.
Will I get a performance improvement if I alternate the above such that the
"emptyMessageFinder()" method sets a boolean attribute (anyEmptyMessage)
in the Message class to true and false, and I'm using following in my drl.
when
m: Message()
m.emptyMessageFinder()
eval(m.anyEmptyMessage) //can I use eval here??
......
If someone can answer these questions it would be a great help!
Thank you in advance!
--
Best Regards,
Nirmal
C.S.Nirmal J. Fernando
Department of Computer Science & Engineering,
Faculty of Engineering,
University of Moratuwa,
Sri Lanka.
Blog: http://nirmalfdo.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20101116/f4a2f561/attachment.html
More information about the rules-users
mailing list