[rules-users] get new errors caused by KnowledgeBuilder.add()
Sandeep Bandela
gibsosmat at gmail.com
Sat Jun 9 19:44:02 EDT 2012
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 of now)
some rules might have compilation errors, hence the
KnowledgeBuilder.hasErrors() is set to true.
those will not be added to the package by the PackageBuilder.
My problem is to log the error causing rule_id and the error message.
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.
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.
is there any elegant way to do this?
I am using drools-5.2.0.final
--
Regards,
Sandeep Bandela.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120610/1f31bdc7/attachment.html
More information about the rules-users
mailing list