Just curiosity.
On 13/11/2013, Steven Williams stevearoo...@gmail.com wrote:
I use something like the following in rules to good effect:
Country( this == Country.USA )
Granted, you can add any number of attributes to an enum so that it's
just another way of writing a static set of bean
We use drools for validation rules in our application. Some of these rules
are dependent on which CRUD operation is being performed at the time, so as
part of our validation aspect we insert a CrudMode enum with the current
action (by annotating the advised method). e.g.
@Validate(validators =
Hello,
I would like to use type-safe enums in my rules. At the moment I have
situation like this:
public class Country {
private String name;
// getter/setters
}
rule Country
when
Country ( name == USA )
then
DO SOMETHING
end
I would like to have something
Using the same name for a fact class Country and an enum Country
will most certainly not be possible unless you use full class names for
disambiguation.
And, of course, the name property of fact class Country would have to
have the enum type.
-W
On 12/11/2013, Stephen Masters
Thanks Steve for the advice and code! Awesome.
--
View this message in context:
http://drools.46999.n3.nabble.com/How-to-use-type-safe-enums-in-rule-condition-tp4026739p4026745.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
I use something like the following in rules to good effect:
Country( this == Country.USA )
---
Steven Williams
On Wed, Nov 13, 2013 at 12:20 AM, droolster quant.co...@gmail.com wrote:
Thanks Steve for the advice and code!