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
Post a Comment