[rules-users] Rule package/rule name/ruleflow-group question

Kris Verlaenen kris.verlaenen at cs.kuleuven.be
Mon Apr 6 21:54:18 EDT 2009


Brian,

Rule names should be unique within their package, ruleflow group names are interpreted globally (so ruleflow groups with the same name in different packages are considered the same).

Multiple packages can be loaded into the same knowledge base.  Assuming you will be using Drools5, it should look something like this:

kbuilder.add(...);
kbuilder.add(...);
...

Collection<KnowledgePackage> pkgs = kbuilder.getKnowledgePackages();
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(pkgs);

final StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

Check out the latest Drools5 documentation for more information:
http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-expert/html/index.html

Rules are always identified as package name + rule name, so they can easily be differentiated.

Kris

  ----- Original Message ----- 
  From: brian.xiang at thomsonreuters.com 
  To: rules-users at lists.jboss.org 
  Sent: Monday, April 06, 2009 5:13 PM
  Subject: [rules-users] Rule package/rule name/ruleflow-group question


  Hi,

  I am new to Drools. I am not sure how rules should be organized using package. 
  My questions are: 

  1) Should rule name/ruleflow-group name be unique within the same package or globally?
  2) Can multiple packages be loaded into workingmemory at the same time? if this true, then I have following quesitons:
      2.1 How to load multiple packages?
      2.2 How the rules have the same name but belong to different packages, are differieniated and fired? 

  Thanks,
  Brian Xiang


------------------------------------------------------------------------------


  _______________________________________________
  rules-users mailing list
  rules-users at lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090407/8ef1183c/attachment.html 


More information about the rules-users mailing list