0

I am newbie to Drools. I have informed from people that, if we use DRL files we dont need to restart server in production system and code changes effects automatically but in my case is not happening... example :

when
$account : Account( balance > 10 )
then
System.out.println("Print");

case 1) so as per above example I have started the server and it starts to given the console in follow since I looped in while(true) in java side

Print
Print
Print
.....
.....
.....,so on 

case 2) Here is the change I am doing with out stopping the jboss server

when
$account : Account( balance > 10 )
then
System.out.println("Changed Print");

now I am expecting the result as

Changed Print
Changed Print
Changed Print
.....
.....
.....,so on 

But the problem is still I am getting cas2 1 ouptput... why DRL is not compiled automatically since I have changed and saved the file.

Do I understand the DRL purposer correct? Your Help appreciated. Thanks

HoldOffHunger
  • 18,769
  • 10
  • 104
  • 133
Will Mcavoy
  • 485
  • 5
  • 24

2 Answers2

0

[Not direct answer, but comment would be too long; based on very limited experience with excel based files.]

It's not mentioned how you are deploying application on server; if it's WAR/JAR etc. then you shouldn't change content of it at runtime or is file externally referenced[through URL may be] at server location, not clear.

Changing files at runtime will not make any effect unless server is configured for hot deployment.

Drools engine has production memory where rules are stored & working memory to maintain facts. Former cannot be changed at runtime while later can be updated.

When you start changing rules, it's just starts getting difficult even to successfully execute it, if executed then to get rule work correctly, class mappings etc. is another part.

Eventually I ended up debugging to check how rules were executed which definitely you wouldn't want to. You can try adding log in drl file would help.

Nayan Wadekar
  • 11,444
  • 4
  • 50
  • 73
0

Drools usually is included in a JBoss stack, which means that following a good design architecture, you will keep them in a separate bundle. That is, on any rule update, this bundle has to be rebuilt and redeployed, without having to restart the server itself.

On the other hand, for your reference, you can also read this answer.

Community
  • 1
  • 1
teobais
  • 2,820
  • 1
  • 24
  • 36