[rules-users] calling a function in When of DRL

wtang wtang at kana.com
Fri Jan 10 03:24:51 EST 2014


I need to call a java function in the LHS (When part of the DRL) like so:

When

eval(DataComparator.compare("key1", "key2"))

where key1 and key2 are keys into a Map encapsulated by DataComparator
class.  How do I pass the Map to the DataComparator class in the first
place.  Do I have to do like so:

eval(DataComparator.init(Map<String, String> map)
eval(DataComparator.compare("key1", "key2")

This all seems like a bad hack to me.

What are the standard best practice to achieve what I need?

Also eval are slow why?  is eval the only way to call a function in the When
part?

thx!



--
View this message in context: http://drools.46999.n3.nabble.com/calling-a-function-in-When-of-DRL-tp4027641.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list