Re: [rules-users] How to use type-safe enums in rule condition

2013-11-13 Thread Wolfgang Laun
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

Re: [rules-users] How to use type-safe enums in rule condition

2013-11-13 Thread Steven Williams
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 =

[rules-users] How to use type-safe enums in rule condition

2013-11-12 Thread droolster
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

Re: [rules-users] How to use type-safe enums in rule condition

2013-11-12 Thread Wolfgang Laun
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

Re: [rules-users] How to use type-safe enums in rule condition

2013-11-12 Thread droolster
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.

Re: [rules-users] How to use type-safe enums in rule condition

2013-11-12 Thread Steven Williams
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!