Edson's proposal is probably what you're after for 5.2+, Guvnor also has an 'internal' API that it uses to construct rules - although this ultimately become DRL that is compiled.

sent on the move

On 1 Jun 2011 15:52, "Mark Proctor" <mproctor@codehaus.org> wrote:
> You can also just generate strings at runtime, either via StringBuilder
> or templating, and compile them at runtime.
>
> Mark
> On 01/06/2011 14:43, Edson Tirelli wrote:
>>
>> David,
>>
>> For 5.2 we are introducing a high level API for rule authoring.
>> Documentation is not ready yet, but you can see the API here:
>>
>> https://github.com/droolsjbpm/drools/tree/master/drools-compiler/src/main/java/org/drools/lang/api
>>
>> DescrFactory is your entry point.
>>
>> Before 5.2, the options are to generate DRL string using templates
>> or build the *Descr AST manually. Please note that the *Descr classes
>> are internal and might change from version to version.
>>
>> Edson
>>
>> 2011/6/1 David Godfrey <davidgodf@gmail.com <mailto:davidgodf@gmail.com>>
>>
>> Hi,
>>
>> Can someone point me in the direction of documentation or code
>> examples for the following? I want to programatically create rules
>> for execution, e.g. within my application I will hold criteria
>> which users will define, at runtime I would like to build a
>> component to extract these values (from my app database) and build
>> rules based on those values. Everything I've seen so far seems to
>> talk about using DRL files, ideally I want to programatically
>> create the entire rule in Java, and then call Drools to execute my
>> rule set.
>>
>> Thanks,
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users@lists.jboss.org <mailto:rules-users@lists.jboss.org>
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>>
>>
>> --
>> Edson Tirelli
>> JBoss Drools Core Development
>> JBoss by Red Hat @ www.jboss.com <http://www.jboss.com>
>>
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>