[rules-users] Advice needed on a Design problem - Orderly execution of rules based on a ruleflow-group and a ruleflow "template" where rule-flow-group is only known at runtime

Pritam infinity2heaven at gmail.com
Mon Jan 18 16:34:07 EST 2010


We have an interesting problem for our site design where we're using drools
as a filtering mechanism to "include" a specific content on the site
(content being a snippet of html).

I need to compile a knowledge base from a root folder, recursively.

  - \site.drl
  - \some-section\some-section.drl
  - \some-section\some-page1.drl
  - \some-section\some-page1-default.drl
  - \some-section\some-page2.drl
  - \some-section\some-page2-default.drl
  - \some-section\.....
  - \another-section\another-section.drl
  - \another-section\blah-page1.drl
  - \another-section\blah-page1-default.drl
  - \another-section\blah-page2.drl
  - \another-section\blah-page2-default.drl
  - ....
 

Assume, a few hundred rule files from the above folder structure, each rule
file having rules with a ruleflow-group corresponding to it's folder
structure. 

At any point, if I fire the rules (using StatelessKnowledgeSession), I
expect a rule flow something  this:

      <START>
           |
         site
           |
       section*
           |
       <XOR>
        /     \
  page*     page-default*    
       \       /
        \     /
       <JOIN>
           |
        <END>


* this ruleflow-group name is dynamic (corresponding to its folder
structure)

As you see, I have a "template" for a rule-flow execution, but my
ruleflow-group name is only known at runtime since it's dependent on the
underling folder structure and not known at ruleflow-definition. I do
however know the folder structure before execution (since you can always
build this via file io using a bootstrap into memory) and the name of the
rule file since I follow a strict naming convention matching the URI of the
http request (which in turn matches the file structure).

How do I build this kind of rule flow execution using rule-flows? Can I
programmatically construct the rule flow and store it in memory? 

Also, assume a knowledge base of hundreds of rules, how do I execute a
specific rulegroup using the StatelessKnowledgeSession api (I can't see any)
from that KnowledgeBase?

Thanks
-- 
View this message in context: http://n3.nabble.com/Advice-needed-on-a-Design-problem-Orderly-execution-of-rules-based-on-a-ruleflow-group-and-a-rulefloe-tp129328p129328.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list