Brian,

    Look for the XXXDescr classes (e.g. RuleDescr, PatternDescr, etc) in drools-compiler. If you populate this classes directly, you avoid the steps of generating the DRL string and parsing them back into the descriptor classes.
    The best you can do to get one example is create a simple program with the rule template you want, use the parser to parse it and inspect the result to know what is expected.

    []s
    Edson


2008/2/27 Brian Trezise <Brian.Trezise@intellidata.net>:
Is there a way to dynamically create rules in java?

Specifically, for a rule in the following general form I have a .txt list of
strings I want to match against and take actions upon.  I know I can make a
.drl out of this list without too much trouble; however the ideal case would
be to simply genearate and load the rules directly into the rulebase.  Is
this possible?  And if so, can you give me a simple example?


rule "name"
no-loop true
salience 0
       when
               sd : SmartDescription(description matches "string",
               possibleFamilyKeySet contains "some value",
               description : description);

       then
               *perform java actions*
end

Any assistance would be appreciated
Thanks,

___________________________________________________
Brian Trezise
Staff Software Engineer
IntelliData, Inc
3173 s. uravan way
aurora, colorado 80013
T: 720.524.4864
brian.trezise@intellidata.net

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



--
 Edson Tirelli
 JBoss Drools Core Development
 Office: +55 11 3529-6000
 Mobile: +55 11 9287-5646
 JBoss, a division of Red Hat @ www.jboss.com