Hi Everyone,<br><br>I found an old example that shows how to add a rule at runtime:<br><br><span style="color: rgb(51, 102, 255);">function void addRule(String pkgName, String rule, RuleBase ruleBase ) {</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">
PackageBuilder builder = new PackageBuilder();</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">
builder.addPackgeFromDrl( new StringReader( rule ) );</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">
ruleBase.addPackage ( builder.addPackage() );</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">
}</span><br><br>I'm trying to do a similar thing with Drools 5 but things seem to have changed. What I want is to add a rule (just as a string) to an already existing set of rules I've loaded from a drl file (the new rule does not have to be saved to the actual file though). I see KnowledgeBase has a remove rule method but no add rule. <br>
I should also note that the set of rules I wish to add to is already executing (as in I've called <i>fireUntilHalt()</i>) I hope this wont make a difference.<br><br>Thanks in advance for any help, this mailing list saves me every time!<br>
<br>Cheers,<br><br>Justin<br>