Re: [rules-users] drools design question

2011-03-17 Thread Michael Anstis
You could hold them all in a single KnowledgeBase with State, FactorY
and FactorX as Facts themselves checked in the Rules' RHS.

You could still have multiple DRL files (to aid authoring and maintenance)
but load them all at once. The RETE network shares nodes for patterns shared
across multiple rules. If your DRLs therefore share RHS patterns (e.g.
simplistically State XX premium for criteria A = 100, State YY premium for
criteria A = 110) the criteria patterns will be shared.

With kind regards,

Mike

2011/3/17 Esteban Aliverti esteban.alive...@gmail.com

 You could also use drools (maybe a decision table) to select the different
 drl files.

 Best regards,

 El mar 16, 2011 8:24 p.m., marunam suta...@gmail.com escribió:


 Hi,

 We are developing an insurance application and we have decided to use drool
 rules for our business rules
 Now, we could have global business rules(applies to all states), specific
 to
 state, specific to factor X, specific to factor Y etc. This way we are
 expecting many drl files.

 Now, when the application runs, we would know the values for state, factor
 X, factor Y etc. and using these values we would determine(using database)
 which drl files to load dynamically and just run the rules in those drls.

 Is this approach recommended? Do you have any suggestions?

 Thanks

 --
 View this message in context:
 http://drools-java-rules-engine.46999.n3.nabble.com/drools-design-question-tp2691182p2691182.html
 Sent from the Drools - User mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] drools design question

2011-03-17 Thread Swindells, Thomas
I'd definitely suggest this approach. Compiling DRL files into a knowledge base 
is very expensive and something  you want to avoid doing as much as possible 
and probably wouldn't come anywhere close to meeting your performance 
requirements!

Thomas

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Michael Anstis
Sent: 17 March 2011 07:52
To: Rules Users List
Subject: Re: [rules-users] drools design question

You could hold them all in a single KnowledgeBase with State, FactorY and 
FactorX as Facts themselves checked in the Rules' RHS.

You could still have multiple DRL files (to aid authoring and maintenance) but 
load them all at once. The RETE network shares nodes for patterns shared across 
multiple rules. If your DRLs therefore share RHS patterns (e.g. simplistically 
State XX premium for criteria A = 100, State YY premium for criteria A = 110) 
the criteria patterns will be shared.

With kind regards,

Mike
2011/3/17 Esteban Aliverti 
esteban.alive...@gmail.commailto:esteban.alive...@gmail.com

You could also use drools (maybe a decision table) to select the different drl 
files.

Best regards,
El mar 16, 2011 8:24 p.m., marunam 
suta...@gmail.commailto:suta...@gmail.com escribió:


Hi,

We are developing an insurance application and we have decided to use drool
rules for our business rules
Now, we could have global business rules(applies to all states), specific to
state, specific to factor X, specific to factor Y etc. This way we are
expecting many drl files.

Now, when the application runs, we would know the values for state, factor
X, factor Y etc. and using these values we would determine(using database)
which drl files to load dynamically and just run the rules in those drls.

Is this approach recommended? Do you have any suggestions?

Thanks

--
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/drools-design-question-tp2691182p2691182.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




**
This message is confidential and intended only for the addressee. If you have 
received this message in error, please immediately notify the 
postmas...@nds.com and delete it from your system as well as any copies. The 
content of e-mails as well as traffic data may be monitored by NDS for 
employment and security purposes. To protect the environment please do not 
print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, 
United Kingdom. A company registered in England and Wales. Registered no. 
3080780. VAT no. GB 603 8808 40-00
**
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] drools design question

2011-03-17 Thread marunam
Thanks everyone for your inputs

Yes, so the confusion that I have is, with loading multiple drls. If I load
all the drls in memory(may be 100s), does it mean that when I say
fireallRules, it is going to run the rules from all the drls?? That is what
I don't want. 

For a particular session at runtime, I may need to run drls from just some
specific drls and not all the drls. How can I tackle this If I load all the
drls?

Thank you

--
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/drools-design-question-tp2691182p2693429.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] drools design question

2011-03-17 Thread Swindells, Thomas
Actually what you want is that only the rules from the DRLs that you want are 
activated and their consequences run (a subtle but important distinction). Put 
another way it doesn't matter how many rules are in the knowledge base and 
evaluated as long as only the rules you want are matched.

There are two main approaches you could do to control this. The first is to use 
agenda groups with rules in different DRLs being in different agenda groups, 
this then lets you control which groups consequences are run and in what order 
to.

Another approach is to introduce some additional facts into the working memory 
- EnabledRuleGroup(String groupName). The first condition in each rule would 
then be the statement exists EnabledRuleGroup(name ==myDlrFilenameXYZ)
Then only rules matching the statement would be evaluated.

There are probably other variations around this too - things like agenda 
filters to filter out the activations you don't want.

Thomas



 -Original Message-
 From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
 boun...@lists.jboss.org] On Behalf Of marunam
 Sent: 17 March 2011 13:31
 To: rules-users@lists.jboss.org
 Subject: Re: [rules-users] drools design question

 Thanks everyone for your inputs

 Yes, so the confusion that I have is, with loading multiple drls. If I
 load
 all the drls in memory(may be 100s), does it mean that when I say
 fireallRules, it is going to run the rules from all the drls?? That is
 what
 I don't want.

 For a particular session at runtime, I may need to run drls from just
 some
 specific drls and not all the drls. How can I tackle this If I load all
 the
 drls?

 Thank you

 --
 View this message in context: http://drools-java-rules-
 engine.46999.n3.nabble.com/drools-design-question-
 tp2691182p2693429.html
 Sent from the Drools - User mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


**
This message is confidential and intended only for the addressee. If you have 
received this message in error, please immediately notify the 
postmas...@nds.com and delete it from your system as well as any copies. The 
content of e-mails as well as traffic data may be monitored by NDS for 
employment and security purposes. To protect the environment please do not 
print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, 
United Kingdom. A company registered in England and Wales. Registered no. 
3080780. VAT no. GB 603 8808 40-00
**

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] drools design question

2011-03-17 Thread Michael Anstis
Don't forget Facts are matched as they are inserted into WorkingMemory too.

fireallRules() only executes the resulting activations on the agenda - that
as Thomas states can be controlled by a number of means.

On 17 March 2011 14:04, Swindells, Thomas tswinde...@nds.com wrote:

 Actually what you want is that only the rules from the DRLs that you want
 are activated and their consequences run (a subtle but important
 distinction). Put another way it doesn't matter how many rules are in the
 knowledge base and evaluated as long as only the rules you want are matched.

 There are two main approaches you could do to control this. The first is to
 use agenda groups with rules in different DRLs being in different agenda
 groups, this then lets you control which groups consequences are run and in
 what order to.

 Another approach is to introduce some additional facts into the working
 memory - EnabledRuleGroup(String groupName). The first condition in each
 rule would then be the statement exists EnabledRuleGroup(name
 ==myDlrFilenameXYZ)
 Then only rules matching the statement would be evaluated.

 There are probably other variations around this too - things like agenda
 filters to filter out the activations you don't want.

 Thomas



  -Original Message-
  From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
  boun...@lists.jboss.org] On Behalf Of marunam
  Sent: 17 March 2011 13:31
  To: rules-users@lists.jboss.org
  Subject: Re: [rules-users] drools design question
 
  Thanks everyone for your inputs
 
  Yes, so the confusion that I have is, with loading multiple drls. If I
  load
  all the drls in memory(may be 100s), does it mean that when I say
  fireallRules, it is going to run the rules from all the drls?? That is
  what
  I don't want.
 
  For a particular session at runtime, I may need to run drls from just
  some
  specific drls and not all the drls. How can I tackle this If I load all
  the
  drls?
 
  Thank you
 
  --
  View this message in context: http://drools-java-rules-
  engine.46999.n3.nabble.com/drools-design-question-
  tp2691182p2693429.html
  Sent from the Drools - User mailing list archive at Nabble.com.
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users



 **
 This message is confidential and intended only for the addressee. If you
 have received this message in error, please immediately notify the
 postmas...@nds.com and delete it from your system as well as any copies.
 The content of e-mails as well as traffic data may be monitored by NDS for
 employment and security purposes. To protect the environment please do not
 print this e-mail unless necessary.

 NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18
 4EX, United Kingdom. A company registered in England and Wales. Registered
 no. 3080780. VAT no. GB 603 8808 40-00

 **

 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] drools design question

2011-03-16 Thread marunam
Hi,

We are developing an insurance application and we have decided to use drool
rules for our business rules
Now, we could have global business rules(applies to all states), specific to
state, specific to factor X, specific to factor Y etc. This way we are
expecting many drl files.

Now, when the application runs, we would know the values for state, factor
X, factor Y etc. and using these values we would determine(using database)
which drl files to load dynamically and just run the rules in those drls. 

Is this approach recommended? Do you have any suggestions?

Thanks

--
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/drools-design-question-tp2691182p2691182.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] drools design question

2011-03-16 Thread Esteban Aliverti
You could also use drools (maybe a decision table) to select the different
drl files.

Best regards,

El mar 16, 2011 8:24 p.m., marunam suta...@gmail.com escribió:

Hi,

We are developing an insurance application and we have decided to use drool
rules for our business rules
Now, we could have global business rules(applies to all states), specific to
state, specific to factor X, specific to factor Y etc. This way we are
expecting many drl files.

Now, when the application runs, we would know the values for state, factor
X, factor Y etc. and using these values we would determine(using database)
which drl files to load dynamically and just run the rules in those drls.

Is this approach recommended? Do you have any suggestions?

Thanks

--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/drools-design-question-tp2691182p2691182.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users