java - Dynamic loading of rules in DROOLS -


i new drools. want understand how dynamically update rules @ run time. considering drools - ability define rules @ runtime?

i wrote code:

 while(true){     session = fetchstatefulsession();//some method drools session     system.out.println("enter text");     //some code read input     session.fireallrules();  } 

now time give input have updated .drl rules file. after result same on,

 session.fireallrules(); 

as earlier. changes in rules not reflected.

i not sure proper way use, dynamic loading of rules. please suggest me

thanks chakri

your code getting session still using same .drl file. code needs include loading .drl files well.

knowledgebuilder.add(resourcefactory.newclasspathresource(rulesfile, yourclass.class), resourcetype.drl); 

but still doubt work or not because loading files @ run time prone error , difficult maintain.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -