Great idea Edson, thanks!

On Wed, Dec 17, 2008 at 1:27 PM, Edson Tirelli <tirelli@post.com> wrote:

   The only improvement I can suggest for your rule is to not use collect if you are checking for the non-existance of and object (size == 0). "not" does the job and is much lighter from a performance perspective:


Cluster($ipAddressCollection : ipAddressCollection != null)
$ipAddressUsage : IPAddressUsage(guid in (IPAddressUsage.CUSTOMER_MANAGEMENT,                                                              
                                                                 IPAddressUsage.CUSTOMER_BACKUP,
                                                                 IPAddressUsage.CUSTOMER_PRODUCTION,
                                                                 IPAddressUsage.CUSTOMER_HEARTBEAT) )
not( IPAddress(ipAddressUsage == $ipAddressUsage) from $ipAddressCollection.ipAddresses )


    []s
    Edson


2008/12/17 David Sinclair <dsinclair@chariotsolutions.com>
I have the when part of a rule

Cluster($ipAddressCollection : ipAddressCollection != null)
$ipAddressUsage : IPAddressUsage(guid in (IPAddressUsage.CUSTOMER_MANAGEMENT,
                                                                 IPAddressUsage.CUSTOMER_BACKUP,
                                                                 IPAddressUsage.CUSTOMER_PRODUCTION,
                                                                 IPAddressUsage.CUSTOMER_HEARTBEAT))
java.util.LinkedList(size == 0) from collect( IPAddress(ipAddressUsage == $ipAddressUsage) from $ipAddressCollection.ipAddresses)

This works fine, but I would like to constrain the IPAddress's usage within the collect, as opposed to joining.

Anyone know if this is possible?

thanks

dave

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




--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.com

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