Hello,
Maybe a typo mistake
but both of your rules have the same agenda group (Phase1)
Regards,
Joel
De :
rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org]
De la part de Rongala, Kanthi
Envoyé : lundi 2 novembre 2009 15:54
À :
rules-users@lists.jboss.org
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.