Question

I am new to drools. I was wondering if eval causes an appreciable decrease in evaluation times? There are certain situations in my current project where I have to to use eval. Is the performance difference worth fretting over? Any alternatives?

I know the question might seem a bit open ended, but just wondering out loud. In case there is a lack of clarity or lack of info, do let me know

Your friendly neighborhood coder,

Avinash

Was it helpful?

Solution 2

The worst problem is that eval is opaque to Drools and so must be re-evaluated every time. The impact this can have on performance may range from negligible to huge, however.

Using eval is first and foremost a code smell in Drools and an indication that the solution should be rethought. In the final analysis it is almost never truly necessary, and if it is necessary, then the whole Drools system may be a wrong tool for the job.

OTHER TIPS

instead of using eval it is possible to evaluate using Boolean wrapper class

// eval(value == "India")

Boolean(booleanValue == true) from value == "India"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top