You need to set the focus for an agenda group to execute.

   []s
   Edson

2009/11/2 Rongala, Kanthi <Kanthi.Rongala@mscibarra.com>

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.

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss by Red Hat @ www.jboss.com