If the list of errors is extended by errors detected during another kb.add(): why not just keep track of the last size() of the list? New errors are bound to appear at the end of the list.<br>-W<br><br><div class="gmail_quote">
On 10 June 2012 01:44, Sandeep Bandela <span dir="ltr">&lt;<a href="mailto:gibsosmat@gmail.com" target="_blank">gibsosmat@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>I have rules (drl format strings) stored in a database column in a schema like MyRules(rule_id integer, name text, rule text, enabled boolean ... )<br>I query the db to get them and iterate over the rows and add using KnowledgeBuilder.add() using String.getBytes. (I dont want to move to guvnor as of now)<br>

some rules might have compilation errors, hence the KnowledgeBuilder.hasErrors() is set to true.<br>those will not be added to the package by the PackageBuilder.<br><br>My problem is to log the error causing rule_id and the error message.<br>

KnowledgeBuilderErrors dosent expose the internal errors list so that I could see if any new errors are in the arraylist from the last time error seen time and log them.<br>But only solution i could think of is using the low level api of using DrlParser to pre-parse it to check for errors+log and add to the kBuilder if its not failed.<br>

<br>is there any elegant way to do this? <br><br>I am using drools-5.2.0.final<span class="HOEnZb"><font color="#888888"><br><br><br><br clear="all"><br>-- <br>Regards,<br>Sandeep Bandela.<br>
<br>
</font></span><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>
<br></blockquote></div><br>