[rules-users] How to break the rules execution if one has been satisfied ??

Nikhil S. Kulkarni Nikhil.Kulkarni at mastek.com
Fri Jun 11 07:27:09 EDT 2010


Hi,

In rules, in a particular rule set, all the when's are executed. In technical terms, the activation is first created. For all the rules in a rule set the when condition is first evaluated and if the when condition is satisfied for any rule then the rule is marked as ready to fire. Once all the when part for all the rules are evaluated then all the ones that were marked for fire are fired.
The performance issue that if there are some 1500 rows. Hence, when the rule is fired there are 1500 when conditions that are firstly checked. And only after this the then part is fired. There is no way to break the when checks on successful satisfaction of a particular rule when.

Example:
If I have say a group of 1000 rules as mentioned below

Rule_1
Salience 1000
When
                Some_Conditions_1
Then
                Some_Actions_1

Rule_2
Salience 999
When
                Some_Conditions_2
Then
                Some_Actions_2
.
.
.
Rule_1000
Salience 1
When
                Some_Conditions_1000
Then
                Some_Actions_1000

Let's assume that Some_conditions_2 = true
Now even though I have an ordering using salience, the rule engine will still execute all the when conditions (Some_Conditions_1 .. Some_Conditions_1000)

Is it possible for me to break this when evaluation even if one has been satisfied?



Thanks & Regards,
Nikhil S. Kulkarni

MASTEK LTD.
Mastek is in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100611/2482cf26/attachment.html 


More information about the rules-users mailing list