Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drools 6.0 dynamically load rules at runtime

Tags:

java

drools

I want to load a drl file at runtime. The posts I've found including this one work for version 5.0 but I can't figure out how to do it for drools version 6.0.

like image 436
Aidan Avatar asked Sep 17 '26 18:09

Aidan


1 Answers

In Drools 6, your rules packages are deployed to Maven. A KieScanner is provided, which you can attach to your KieContainer. This polls your repository at a defined interval to see whether a package has been updated and downloads the latest if that's the case.

A full explanation of how to define a KieScanner (including code samples) is provided in the Drools documentation here:

https://docs.jboss.org/drools/release/latest/drools-docs/html/ch04.html

like image 179
Steve Avatar answered Sep 19 '26 07:09

Steve



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!