<br> Brian,<br><br> 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.<br>
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.<br><br> []s<br> Edson<br><br><br><div class="gmail_quote">
2008/2/27 Brian Trezise <<a href="mailto:Brian.Trezise@intellidata.net">Brian.Trezise@intellidata.net</a>>:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Is there a way to dynamically create rules in java?<br>
<br>
Specifically, for a rule in the following general form I have a .txt list of<br>
strings I want to match against and take actions upon. I know I can make a<br>
.drl out of this list without too much trouble; however the ideal case would<br>
be to simply genearate and load the rules directly into the rulebase. Is<br>
this possible? And if so, can you give me a simple example?<br>
<br>
<br>
rule "name"<br>
no-loop true<br>
salience 0<br>
when<br>
sd : SmartDescription(description matches "string",<br>
possibleFamilyKeySet contains "some value",<br>
description : description);<br>
<br>
then<br>
*perform java actions*<br>
end<br>
<br>
Any assistance would be appreciated<br>
Thanks,<br>
<br>
___________________________________________________<br>
Brian Trezise<br>
Staff Software Engineer<br>
IntelliData, Inc<br>
3173 s. uravan way<br>
aurora, colorado 80013<br>
T: 720.524.4864<br>
<a href="mailto:brian.trezise@intellidata.net">brian.trezise@intellidata.net</a><br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>