[rules-users] Don't process rules when adding new package to rulebase

Barraq nospam at barraquand.com
Wed May 28 07:00:24 EDT 2008


Hi there,

I'm developing a library that uses drools as a REAL-TIME rule engine. What
i'm a doing right now is to have a thread that wakes up each 100ms and do a
fireAllRules(1000).

I need to be able to load Facts and Rules on the fly, even after the
statefullsession is created. The problem is that when i add a new
RulePackage to the current rulebase's session, all the rules inside this
package are evaluated ! and so i never exit from this addPackage function !!

System.out.println("Start loading rules");

// build builder package configuration
PackageBuilderConfiguration conf = new PackageBuilderConfiguration();
conf.setClassLoader(factionary);

// Load file
File file = new File(chooser.getSelectedFile().getPath());
PackageBuilder builder = new PackageBuilder(conf);

builder.addPackageFromDrl(new FileReader(file));

// Load package to session
session.getRuleBase().addPackage(builder.getPackage()); // GET STUCK HERE
!!!!!!!!!!!

// Print success
jTextArea2.append(chooser.getSelectedFile().getPath()+"\n");
jTextArea2.setCaretPosition(jTextArea1.getDocument().getLength());

System.out.println("Done loading rules");

What i want is just to add the rules from the package that's all.... Since
i've a thread that call fireAllRules(1000) each 100ms the rules will get
proceced next time :)

Do you have any idea of how to do that ?

Thanks.

Barraquand Rémi

-- 
View this message in context: http://www.nabble.com/Don%27t-process-rules-when-adding-new-package-to-rulebase-tp17508315p17508315.html
Sent from the drools - user mailing list archive at Nabble.com.





More information about the rules-users mailing list