<br> Samir, <br><br> I had a look at the code you sent me and the problem is that you are not adding the rule to the rulebase. In your ConnectionHandler.testDynamicRules() method, you need to do:<br><br> ruleBase.addPackage( builder.getPackage() );<br>
<br> You probably incurred in this error because you are misusing the Package objects. You should either remove the whole package from the rule base before doing your merge or, what I think is best, create a package with the "delta" rules you want to add.<br>
So, instead of doing:<br><br> Package defaultPackage = pkg[0];<br> <br> Do:<br><br> Package defaultPackage = new Package( pkg[0].getName() );<br><br> So, you are effectively creating a new Package object, but when you add it to the rule base, it will be correctly merged into the existing one.<br>
This also allows you to AVOID the lock you are doing here:<br><br> ruleBase.lock(); // no need for that if you use a new package with the same name<br> packageDescr.addRule( ruleDescr );<br>
builder.addPackage(packageDescr);<br> ruleBase.unlock(); // no need for that if you use a new package with the same name<br><br> Hope it helps.<br><br> Edson<br><br><div><span class="gmail_quote">2008/3/8, Mark Proctor <<a href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
samirsss wrote:
<blockquote type="cite">
<pre>Hi Edson,<br><br>I just saw Mark Proctor's message about filing bugs so that they get<br>addressed in 4.0.5 and was wondering if the fix for this issue is also going<br>to be in the same release? Thanks for being so proactive about the issues<br>
and having a quick turnaround time.<br> </pre>
</blockquote>
yes it is, please try 4.0.x to be sure your bug is fixed.<span class="q"><br>
<blockquote type="cite">
<pre>regards<br>Samir<br><br>samirsss wrote:<br> </pre>
<blockquote type="cite">
<pre>Hi Edson,<br><br>I did send you an email with the sample of how to recreate this issue and<br>hopefully you can also find the issue and get a fix out. Meanwhile I am<br>planning to write the new rule back to the rule file and re-initialize the<br>
Rulebase with the updated drl file, which works fine.<br><br>-Samir<br><br><br>Edson Tirelli-3 wrote:<br> </pre>
<blockquote type="cite">
<pre> Can you please provide an executable, self contained test case? I will<br>take a look.<br><br> []s<br> Edson<br><br> </pre>
</blockquote>
</blockquote>
<pre> </pre>
</blockquote>
<br>
</span></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<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>