Re: [rules-users] Using Enumeration for long lists

2011-07-05 Thread Wolfgang Laun
On 5 July 2011 10:54, lansyj  wrote:

> Hi,
>
> I understand Drools does support enumerated lists of values for checking
> conditions and assigning consequences. Am i mistaken?
>

It's using a Rete network, and I've never heard "enumerated lists of values"
in any description of the involved algorithms. Where does this come from?


> The ID would be a numeric value of 8 or 12 bytes in length. The Blacklist
> validation would be just the basic full word match.
>

Basically a subset of positive "long" values; if area codes are involved,
distribution is not regular (even within a certain number of  digits). But a
hash lookup on the String value should give you good performance.

   Subscriber( $addr: address )
   Blacklist( set contains $addr )
then
   refuse...

-W


>
> Best Regards
>
> -lj
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Using-Enumeration-for-long-lists-tp3140051p3140095.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Using Enumeration for long lists

2011-07-05 Thread Michael Anstis
Guvnor supports enumerated lists of values that can be included in rules.

Drools itself (the "rule engine") provides for the compilation and execution
of rules; ultimately written in plain text - Guvnor provides a UI layer of
abstraction over the text generation that allows use of enumerations.

You can use Java enumerations in Drools rule definitions, but you still need
to write the rules using such enumerations.

On 5 July 2011 09:54, lansyj  wrote:

> Hi,
>
> I understand Drools does support enumerated lists of values for checking
> conditions and assigning consequences. Am i mistaken?
>
> The ID would be a numeric value of 8 or 12 bytes in length. The Blacklist
> validation would be just the basic full word match.
>
> Best Regards
>
> -lj
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Using-Enumeration-for-long-lists-tp3140051p3140095.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Using Enumeration for long lists

2011-07-05 Thread lansyj
Hi, 

I understand Drools does support enumerated lists of values for checking
conditions and assigning consequences. Am i mistaken?

The ID would be a numeric value of 8 or 12 bytes in length. The Blacklist
validation would be just the basic full word match.

Best Regards

-lj

--
View this message in context: 
http://drools.46999.n3.nabble.com/Using-Enumeration-for-long-lists-tp3140051p3140095.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Using Enumeration for long lists

2011-07-05 Thread Swindells, Thomas
How complex are the blacklist rules that you are planning to have?
>From what you have described it sounds like it is just substring/startswith 
>matches?
If this is the case then you may be better just to query lucene or the database
directly as you'll result in a very flat extremely wide graph that drools isn't 
going
to be able to optimize at all - it will basically just iterate over every 
string doing the
string comparison.
Lucene/the database are likely to be much more optimized and efficient for this.

If on the other hand your blacklist logic is much more complicated, taking into
account multiple criteria such as username, time of day, source ip address,
phase of the moon etc then drools may be easier to optimize development
speed and maintainance,.

Thomas

> -Original Message-
> From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
> boun...@lists.jboss.org] On Behalf Of lansyj
> Sent: 05 July 2011 09:39
> To: rules-users@lists.jboss.org
> Subject: [rules-users] Using Enumeration for long lists
>
> Hi,
>
> We are planning to use Drools for a Blacklist validation logic which requires 
> us
> to manage very long list (could be tens of thousands of IDs).
> Can we use the native Drools enumeration for this? Would this be an optimal
> implementation?
>
> The other option we were thinking of was to have a list managed separately
> in our core application and have in lucene indexed such that Drools rule
> checks against the index. But, as you can see, it creates a lot of development
> as well as maintenance overhead.
>
> Thanks in advance for any tips on this topic.
>
> Best Regard
>
> -lj
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/Using-
> Enumeration-for-long-lists-tp3140051p3140051.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users


**
This message is confidential and intended only for the addressee. If you have 
received this message in error, please immediately notify the 
postmas...@nds.com and delete it from your system as well as any copies. The 
content of e-mails as well as traffic data may be monitored by NDS for 
employment and security purposes. To protect the environment please do not 
print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, 
United Kingdom. A company registered in England and Wales. Registered no. 
3080780. VAT no. GB 603 8808 40-00
**

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


Re: [rules-users] Using Enumeration for long lists

2011-07-05 Thread Wolfgang Laun
On 5 July 2011 10:39, lansyj  wrote:

> Hi,
>
> We are planning to use Drools for a Blacklist validation logic which
> requires us to manage very long list (could be tens of thousands of IDs).
> Can we use the native Drools enumeration for this?


What do you mean by "native Drools enumeration"?



> Would this be an optimal
> implementation?
>

IDs such as phone numbers or email addresses are strings, so what sort of
access do you need that's not efficiently feasible with a hash map or hash
set? Detailed knowledge of the value disrtibution of your IDs might be used
for an optimum hash function, but that's a technicality.

-W


>
> The other option we were thinking of was to have a list managed separately
> in our core application and have in lucene indexed such that Drools rule
> checks against the index. But, as you can see, it creates a lot of
> development as well as maintenance overhead.
>
> Thanks in advance for any tips on this topic.
>
> Best Regard
>
> -lj
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Using-Enumeration-for-long-lists-tp3140051p3140051.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Using Enumeration for long lists

2011-07-05 Thread lansyj
Hi, 

We are planning to use Drools for a Blacklist validation logic which
requires us to manage very long list (could be tens of thousands of IDs).
Can we use the native Drools enumeration for this? Would this be an optimal
implementation?

The other option we were thinking of was to have a list managed separately
in our core application and have in lucene indexed such that Drools rule
checks against the index. But, as you can see, it creates a lot of
development as well as maintenance overhead.

Thanks in advance for any tips on this topic.

Best Regard

-lj

--
View this message in context: 
http://drools.46999.n3.nabble.com/Using-Enumeration-for-long-lists-tp3140051p3140051.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users