hongwen1993 / fast-drools-spring-boot-starter

Easy drools,version 8.0.8
634 stars 134 forks source link

Dynamic update issue #15

Closed ajitkumargiri closed 2 months ago

ajitkumargiri commented 2 years ago

Hi Author, What is the best way to load drl file dynamically? Because all the rule files are inside the application resources. If we need to update one drl file what we need to do.

Thanks in advance.

heyaheng1995 commented 2 years ago

我收到了。看到后会尽快回复。

tangwan commented 1 year ago

Hi Author, What is the best way to load drl file dynamically? Because all the rule files are inside the application resources. If we need to update one drl file what we need to do.

Thanks in advance.

drools use lancher Classloader, while devtools treats our self-written model as a class that can change at any time, so the Restart ClassLoader is used for loading (for fast hot deployment). devtools will have two class loaders, a Classloader that loads the classes that don't change (third-party Jar packages) and a ClassLoader that loads the classes that do change, called the Restart ClassLoader. When the A Class loaded by the Launcher ClassLoader is compared with the A class loaded by the Restart ClassLoader, it is found to be inconsistent, so the drools engine cannot recognize it naturally.

you can put .drl file outside your project.

spring:
   drools:  
      path: C:/drools/
heyaheng1995 commented 1 year ago

我收到了。看到后会尽快回复。