Hello,

Maybe a typo mistake but both of your rules have the same agenda group (Phase1)

Regards,

Joel
________________________________
De : [email protected] 
[mailto:[email protected]] De la part de Rongala, Kanthi
Envoyé : lundi 2 novembre 2009 15:54
À : [email protected]
Objet : [rules-users] Agenda Groups basic question

Hi,

I am new to Drools and trying my hands out at Drools 5. I cann't figure out how 
to use agenda- groups. I have a small drl file with two agenda groups and one 
rule per agenda-group. This doesn't seem to work. However if I happen to 
comment out the agenda-group attribute, the results are as expected.

Please let me know what I am missing.

package com.mscibarra.examples.drools.controllers;

import com.mscibarra.examples.drools.domainentities.*;


rule "Detect and Remove Duplicate Shelves"
agenda-group "Phase1"
lock-on-active
dialect "mvel"
when
      $universe : LibraryUniverse()
      $shelf : Shelf() from $universe.shelves
      $shelf2 : Shelf(this != $shelf) from $universe.shelves
then
      System.out.println("Duplicate Shelves found::"+$shelf);
      // without the modify(), drools is not alerted about changes
      // $universe.shelves.remove($shelf);
      /*
      modify($universe) {
            shelves.remove($shelf);
      };
      */

end

rule "Singleton Shelf Detector"
agenda-group "Phase1"
lock-on-active
dialect "mvel"
when
      $universe : LibraryUniverse(shelves.size > 1)
then
      System.out.println("Multiple Shelves found::"+$universe.shelves.size);
End



With Regards,
Kanthi Swaroop Rongala



________________________________
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. 

--------------------------------------------------------

 
Ce courriel et toutes les pièces jointes sont confidentiels et peuvent être 
couverts par un privilège ou une protection légale. Il est établi à l'attention 
exclusive de ses destinataires. Toute utilisation de ce courriel non conforme à 
sa destination, toute diffusion ou toute publication, totale ou partielle, est 
interdite, sauf autorisation expresse préalable. Toutes opinions exprimées dans 
ce courriel ne sauraient nécessairement refléter celle de Natixis, de ses 
filiales. Elles sont aussi susceptibles de modification sans notification 
préalable. Si vous recevez ce courriel par erreur, merci de le détruire et d'en 
avertir immédiatement l'expéditeur. L'Internet ne permettant pas d'assurer 
l'intégrité de ce courriel, Natixis décline toute responsabilité s'il a été 
altéré, déformé ou falsifié et chaque destinataire qui utilise ce mode de 
communication est supposé en accepter les risques.
 
This email and any attachment are confidential and may be legally privileged or 
otherwise protected from disclosure. It is intended only for the stated 
addressee(s) and access to it by any other person(s) is unauthorised. Any use, 
dissemination or disclosure not in accordance with its purpose, either in whole 
or in part, is prohibited without our prior formal approval. Any opinion 
expressed in this email may not necessarily reflect the opinion of Natixis, its 
affiliates. It may also be subject to change without prior notice. If you are 
not an addressee, you must not disclose, copy, circulate or in any other way 
use or rely on the information contained in this email. If you have received it 
in error, please inform us immediately and delete all copies. The Internet can 
not guarantee the integrity of this email therefore Natixis shall not be liable 
for the email if altered, changed or falsified and anyone who communicates with 
us by e-mail is taken to accept these risks.
--------------------------------------------------------
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to