tags:

views:

64

answers:

1

How to build Drools rules in Java dynamically instead of providing static drl file?

I have a set of matching rules defined in xml that I need to parse and be able to reload it in runtime. Is there any way to build Drools rules dynamically? Couldn't find it in the docs.

A: 

I agree with Romain's comment - if you have the rules in some declarative form - you could just generate code directly from that - unless there is higher order logic implicit in those rules (unlikely I have found), or perhaps you want to do a one time migration to a rule language out of the XML.

Michael Neale
No, I just want to use quick and tested Rete algorithm implementation. I need to create possibly large set of rules and fire them against lots of facts. I believe that straight 'if' realization wont be optimal. Anyway, I decided to generate rules file and compile it in runtime.
nau