[rules-users] Is there a faster way of doing this in Drools ?

Vincent LEGENDRE vincent.legendre at eurodecision.com
Wed May 9 15:12:09 EDT 2012


> ... OR load everything into a WM and then apply these "dynamic" rules. 

Beware, I am not sure whether we can add/remove rules in an existing session (I don't think so but I may be wrong).
Basically, a WM is built from a kBase, not the inverse ...
So you will have to recompile rules, that re-add all data in the WM ... really not a good idea then ...

But, if you have your own GUI to set the filters, you should have some masks to speficify your filtering values, or at least some objects to store the filters/user's choices to display them in some screens, right ?

In that case, you can add these objects directly in the WM, and write generic rules that use these objects to filter the raw data (as 2 or 3 previous post suggest). This way, you build your KB once, create a 'deamon' session, add all raw data once, and then only insert/retract filtering objects, with the results updated dynamically too. And if you can only work on differences (ie a result entering or getting out the global result list by invoking a gui callback), it can even be faster than a DB ... because RETE is good to propagate small diffs over a large amount of data and deduce related diffs on the outcome (this is drools-planner raw idea too).






More information about the rules-users mailing list