Hi,
I'm trying to access to a property of an Enum but I get the following error:
Unable to create restriction '[QualifiedIndentifierRestr: == Direction.S.name ]'
for field 'directionAsString' in the rule 'enum test'
Here is the code for my Enum:
public enum Direction {
N("North"), S("South"), E("East"), W("West");
private final String name;
private Direction(String name) {
this.name = name;
}
public String getName() {
return this.name;
}
}
And here is my Rule:
rule "enum test"
when
$to : TestObject($ds: directionAsString == Direction.S.name);
then
System.err.println("OK");
end
Is there a reason why I cannot do that ?
Thanks for your help
-Patrick
Patrick Gras
GENERALI Assurances
Service Informatique
Avenue Perdtemps 23
1260 Nyon 1
Tél. direct: +41 58 471 05 87
<mailto:patrick.gras@generali.ch>
P Please consider the environment before printing this E-Mail!