[rules-users] How to get notified just before rule is picked up for evaluation

Mattias Nilsson Grip mattias.nilsson.grip at redpill-linpro.com
Thu Nov 15 02:13:49 EST 2012


Hi Ghanshyam,

I'm afraid there is no such way. The reason is that Drools does not evaluate rules one by one. A rule can consist of multiple conditions and some of those conditions can be shared by multiple rules (node sharing in RETE network).

When you insert a fact into your session, conditions from multiple rules for that fact type are evaluated. So different parts of a rule's conditions may be evaluated at different times during your insert of facts.

Only when all conditions for a rule have been evaluated to true an activation is created.

Regards,
Mattias

----- Original Message -----
From: GPatel at tsys.com
To: rules-users at lists.jboss.org
Sent: Thursday, 15 November, 2012 2:41:04 AM
Subject: [rules-users] How to get notified just before rule is picked up for	evaluation


Is there a way to get a hook into just before a rule is evaluated to determine whether an activation is created ? 

The earliest hook available is DefaultAgendaEventListener . activationCreated(ActivationCreatedEvent event) 

What I am looking for is to get notified just before a rule is picked up for evaluation and just after it has been evaluated. 

Thanks 
Ghanshyam ----------------------------------------- The information contained in this communication (including any attachments hereto) is confidential and is intended solely for the personal and confidential use of the individual or entity to whom it is addressed. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this communication in error and that any review, dissemination, copying, or unauthorized use of this information, or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. Thank you 
_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


More information about the rules-users mailing list