This was fixed recently for 5.3.0.Final.... <br><br>You can use either &quot;multiple field constraints&quot; or &quot;Add more options to this fields values&quot; (the icon at the end of a field constraint).<br><br><div class="gmail_quote">
On 5 October 2011 16:43, enkidu <span dir="ltr">&lt;<a href="mailto:paul_blampied@yahoo.co.uk">paul_blampied@yahoo.co.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I&#39;ve been playing with Drools and Guvnor and think I&#39;ve encountered a problem<br>
with Java enums in Guvnor. I&#39;ve searched for previous enum bugs and seen<br>
that a lot have been fixed, but I&#39;ve tried Guvnor 5.2.0 and 5.3.0.CR1 and it<br>
happens in both.<br>
<br>
The problem seems to happen when you use enums in a &quot;multiple field<br>
constraint&quot; on a fact, eg:<br>
<br>
  There is a Person with:<br>
    any of the following:<br>
      role equal to Role.TEACHER<br>
      role equal to Role.PARENT<br>
<br>
Then using &quot;view source&quot; to see the generated DRL, the enum values are<br>
enclosed in double quotes, ie:<br>
<br>
  rule &quot;test&quot;<br>
      dialect &quot;mvel&quot;<br>
      when<br>
          Person( role == &quot;Role.TEACHER&quot; || role == &quot;Role.PARENT&quot; )<br>
      then<br>
  end<br>
<br>
If I just do a single field constraint then it comes out fine, eg. Person(<br>
role == Role.TEACHER )<br>
<br>
Is this a bug or am I doing something stupid? I&#39;ve seen posts recommending<br>
the use of string constants rather than enums - is this the workaround?<br>
<br>
Below is my simple Java model for completeness:<br>
<br>
public enum Role {<br>
    TEACHER,<br>
    STUDENT,<br>
    PARENT<br>
}<br>
<br>
public class Person {<br>
<br>
    private String name;<br>
    private Role role;<br>
<br>
    public Person( String name, Role role ) {<br>
        <a href="http://this.name" target="_blank">this.name</a> = name;<br>
        this.role = role;<br>
    }<br>
<br>
    public String getName() { return name; }<br>
<br>
    public Role getRole() { return role; }<br>
}<br>
<font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Problem-with-Java-enums-in-Guvnor-multiple-field-constraints-tp3396901p3396901.html" target="_blank">http://drools.46999.n3.nabble.com/Problem-with-Java-enums-in-Guvnor-multiple-field-constraints-tp3396901p3396901.html</a><br>

Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br>