I’m not sure your use case, but I will answer what I think you are asking. We had the need of turning on/off rules per time the rules were fired. So different data may need different rules to fire, and simply too dynamic to build rules around. It is as simple as a manager may choose to override a price that has been returned by the engine. To do this we made sure all rules have unique names with a  number. So it could be foo-bar-123, foo-bar-124. The transaction ID and the rule ID can then be stored in a database to persist the override, so transaction ID 987. When the rules fire for a transaction you check to see if overrides exist and filter out and rules that should be overridden. The rules still fire, they are just ignored. For us this has worked well in an environment where we want all transactions to potentially be overridden and ignored. There may be a more elegant way to do this purely in the rule, but I haven’t seen it.

 

On a side note, it would be awesome if the BRMS had a way to store/generate unique IDs for each rule, that could be easily returned/fetched when a rule fired.

 

-Michael

 

From: rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Ravi Krishnamurthy
Sent: Tuesday, September 02, 2008 2:37 PM
To: Rules Users List
Subject: Re: [rules-users] Turning on and off a particular rule

 

Pallav:
the enabled keywork works.

In order to do this, the rules need to be updated at runtime. Wondering if there is any other way other than updating the rules to get this behavior during runtime.

Thanks,
Ravi

Ravi wrote:

Thanks Shyam, will try it out.


From: rules-users-bounces@lists.jboss.org [rules-users-bounces@lists.jboss.org] On Behalf Of Shyam, Pallav (MSCIBARRA) [Pallav.Shyam@mscibarra.com]
Sent: Monday, September 01, 2008 12:49 PM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] Turning on and off a particular rule

To turn off a rule write
enabled false

on the line after the rule name.

Pallav

----- Original Message -----
From: rules-users-bounces@lists.jboss.org <rules-users-bounces@lists.jboss.org>
To: Rules Users List <rules-users@lists.jboss.org>
Sent: Tue Sep 02 02:20:27 2008
Subject: [rules-users] Turning on and off a particular rule

Hello:
Wondering if it is possible to enable or disable a rule after the rules are defined in a project.

Thanks,
Ravi


NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.