I'm new to drools and I'm working on a project where I need to have the drools engine realize a drl file is updated and rebuild its rules. I've looked into using the kie scanner, but that looks messy and requires maven and git. For brevity sake, lets just assume our maven repository is off limits for this use. Is it possible to point the scanner (or something else) to a drl file sitting on the file system and have it update the project if that file gets updated?
2
votes
1 Answers
0
votes
If you don't want to use the built in scanning functionality, there is the Java WatchService, which will provide notifications of directory changes, and rebuild your knowledge base when there are changes:
http://docs.oracle.com/javase/tutorial/essential/io/notification.html
Rebuilding the knowledge base just involves destroying the current knowledge base and creating a new one.
Edit - I previously mentioned using either the Spring Integration or Camel file polling consumers. These are more for dropping a file into a directory, from which it will be picked up, processed and generally removed from that directory. That's not so suitable if the intent is to modify DRL files in place and expect knowledge base reloads in response to those changes.