[rules-users] Using Guvnor rule to check if page is in a list of pages (enumeration)? Contains?

Kevin mrjabba at gmail.com
Fri Oct 22 04:20:14 EDT 2010


Hi,

I'm investigating Drools Guvnor for use as both entitlements and
business rules where "entitlements" means I
am checking access to certain web pages (or partial page resources)
based on a pre-defined a resource (given a role for example) that I
would send in when executing the rule.

Is it possible to populate my Fact with the resource for the left hand
side and have the rule check to see if that value exists in
the right hand side (presumably populated from an Enumeration).

So far it seems to want me to pick a value. Instead, I want to say
that any of these values are OK.
I guess I'm asking if it can do a contains rather than equals from a list.

Fact example:

Fact name: Resource
field: resourceName

Enumeration name: Resources
'Resource.resourceName': ['somedirectory', 'foo/bar.html', 'etc/blah.html']

Rule Example:
When
There is a  Resource.resourceName 'contains' a value from Resources

Then
Permit = true (or similar)

Sorry if this is covered in the manual and I missed it.

Using Guvnor 5.1.1.

Thanks!
K



More information about the rules-users mailing list