[rules-users] Writing a rule to find a fact that has a minimum value
Esteban Aliverti
esteban.aliverti at gmail.com
Wed Dec 19 10:37:04 EST 2012
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 at 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 at 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 at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20121219/74629856/attachment.html
More information about the rules-users
mailing list