tags:

views:

30

answers:

1

When i modified a rule in .drl, modified don't take effect. Is it possible to modified (i.e. hot deploy) a rule (.drl) in drools without restarting the server (tomcat)? How can i resolve this?

A: 

Yes it is - there are a few ways - but the first question is how you are loading the rules in the first place - are you loading them from the classpath? or somewhere on disk? There is a KnowledgeAgent (and RuleAgent) class that can load it from a variety of sources, and detect changes and apply them for you automatically when you change a drl file.

Michael Neale
I create a knowledgeBase with spring and then i create a session and fire rules just when i need to be executed. I think that the problem with KnowledgeAgent is that it's continuesly scanning directories, is it performance? Thanks in advance!
martin
The scanning shouldn't normally be an issue. one day (java 7?) that can go away as true file notifications are possible.
Michael Neale