Re: [rules-users] get new errors caused by KnowledgeBuilder.add()

2012-06-10 Thread Wolfgang Laun
I'd just instanceof test the Collection against List and cast. Second, consider an issue requiring support for error checking with this additive kind of build. If all of your rules are in the same package, consider concatenating the rules strings in a string builder and feed the results to the KB

Re: [rules-users] get new errors caused by KnowledgeBuilder.add()

2012-06-10 Thread Sandeep Bandela
yeah the internal impl is arraylist but the interface is a collection, so everytime I had to convert it to array and keep counter of last-error-index and fetch new KnowledgeBuilderErrors on the collection, or use iterator to iterate the last-error-index and continue till the end of the collection.

Re: [rules-users] get new errors caused by KnowledgeBuilder.add()

2012-06-09 Thread Wolfgang Laun
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. -W On 10 June 2012 01:44, Sandeep Bandela wrote: > Hi, > I have rules (drl format strings) stored in a data

[rules-users] get new errors caused by KnowledgeBuilder.add()

2012-06-09 Thread Sandeep Bandela
Hi, 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 ... ) 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