rule 'Smallest city'
when
   $smallCity: City()
   not City(population < $smallCity.population)
then
   System.out.println("This is the smallest city: "+$smallCity);
end

Best Regards,


XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti
- Blog @ http://ilesteban.wordpress.com


On Wed, Dec 19, 2012 at 4:20 PM, David R Robison <drrobison@openroadsconsulting.com> wrote:
I want to write a rule that will select a fact that has the minimum
value for an attribute. For example, find the city that has the minimum
population. How would I write such a rule? David

--

David R Robison
Open Roads Consulting, Inc.
103 Watson Road, Chesapeake, VA 23320
phone: (757) 546-3401
e-mail: drrobison@openroadsconsulting.com
web: http://openroadsconsulting.com
blog: http://therobe.blogspot.com
book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526



This email communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed.
If you are not the intended recipient, please delete this email immediately.


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