[rules-users] how to restore the knowledgeBase when newly created kb has compilationFailed error
Hi there, I am using KnowledgeAgent to get the knowledgeBase and have notifierService started to monitor the rules resource. New knowledgeBase is being created when kAgent finds changes on the rules. However, I don't want to replace the old knowledgebase if newly created knowledgebase has some rules with compilation error. Is this something possible? I am using KnowledgeAgentEventListener to detect the compilation error and using drools 5.3 version. thanks in advance. -- View this message in context: http://drools.46999.n3.nabble.com/how-to-restore-the-knowledgeBase-when-newly-created-kb-has-compilationFailed-error-tp4027387.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] how to restore the knowledgeBase when newly created kb has compilationFailed error
There is a newInstance option in the KA configuration that determines whether the changes are applied to the existing KB, or a new one is to be created. Please see the documentation for more details. As a side note, the KA was refactored and improved in 5.5 and 5.6 to fix some bugs and missing features. Let me know if you have more questions Best Davide On 12/20/2013 11:27 AM, bhochhi wrote: Hi there, I am using KnowledgeAgent to get the knowledgeBase and have notifierService started to monitor the rules resource. New knowledgeBase is being created when kAgent finds changes on the rules. However, I don't want to replace the old knowledgebase if newly created knowledgebase has some rules with compilation error. Is this something possible? I am using KnowledgeAgentEventListener to detect the compilation error and using drools 5.3 version. thanks in advance. -- View this message in context: http://drools.46999.n3.nabble.com/how-to-restore-the-knowledgeBase-when-newly-created-kb-has-compilationFailed-error-tp4027387.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] how to restore the knowledgeBase when newly created kb has compilationFailed error
Thanks for the reply, so far from documentation, I believe newInstance=true(default) replaces the old kb as a whole and =false will update the existing kb. But I didn't see anywhere explaining that if there is a compilation error on rules, it will not update the kb. And I verified. It updates the kb. I don't know if that is expected or bugs in this version. Anyway, I found the workthrough by assigning the kb to the variable and update it only if there is not resourceCompilationFailed using knowledgeBaseUpdated event on KnowledgeAgentEventListener. Anyway, thanks for your help. -- View this message in context: http://drools.46999.n3.nabble.com/how-to-restore-the-knowledgeBase-when-newly-created-kb-has-compilationFailed-error-tp4027387p4027389.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] how to restore the knowledgeBase when newly created kb has compilationFailed error
That feature was definitely not available in 5.3... I would have to check in 5.6, and I agree that it would be a nice feature to have. I'll see if we are still in time to add it. Davide On 12/20/2013 12:35 PM, bhochhi wrote: Thanks for the reply, so far from documentation, I believe newInstance=true(default) replaces the old kb as a whole and =false will update the existing kb. But I didn't see anywhere explaining that if there is a compilation error on rules, it will not update the kb. And I verified. It updates the kb. I don't know if that is expected or bugs in this version. Anyway, I found the workthrough by assigning the kb to the variable and update it only if there is not resourceCompilationFailed using knowledgeBaseUpdated event on KnowledgeAgentEventListener. Anyway, thanks for your help. -- View this message in context: http://drools.46999.n3.nabble.com/how-to-restore-the-knowledgeBase-when-newly-created-kb-has-compilationFailed-error-tp4027387p4027389.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users