<br>&nbsp;&nbsp;&nbsp; Brian,<br><br>&nbsp;&nbsp;&nbsp; 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>
&nbsp;&nbsp;&nbsp; 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>&nbsp;&nbsp;&nbsp; []s<br>&nbsp;&nbsp;&nbsp; Edson<br><br><br><div class="gmail_quote">
2008/2/27 Brian Trezise &lt;<a href="mailto:Brian.Trezise@intellidata.net">Brian.Trezise@intellidata.net</a>&gt;:<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. &nbsp;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. &nbsp;Is<br>
this possible? &nbsp;And if so, can you give me a simple example?<br>
<br>
<br>
rule &quot;name&quot;<br>
no-loop true<br>
salience 0<br>
 &nbsp; &nbsp; &nbsp; &nbsp;when<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sd : SmartDescription(description matches &quot;string&quot;,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;possibleFamilyKeySet contains &quot;some value&quot;,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;description : description);<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;then<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*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> &nbsp;Edson Tirelli<br> &nbsp;JBoss Drools Core Development<br> &nbsp;Office: +55 11 3529-6000<br> &nbsp;Mobile: +55 11 9287-5646<br> &nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>