[rules-users] Agenda Groups basic question
Edson Tirelli
ed.tirelli at gmail.com
Mon Nov 2 10:51:32 EST 2009
You need to set the focus for an agenda group to execute.
[]s
Edson
2009/11/2 Rongala, Kanthi <Kanthi.Rongala at 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 at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20091102/e88d48d7/attachment.html
More information about the rules-users
mailing list