At first glance, the problem is with the MyType property DefaultType _default. What are the names of the getter and setter?<br><br>Renaming the field to <br> DefaultType default<br>with getter getDefault and setter setDefault is bound to fix the problem.<br>
<br>-W<br><br><br><div class="gmail_quote">2011/7/27 Eugenia Carcel <span dir="ltr"><<a href="mailto:eujenia@gmail.com">eujenia@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>I get the following error when I try to build and deploy:<br>Unable to build constraint as '_default' is invalid : [Rule name='myRuleName']<br><br>It yields this error because of this pattern in my drl file:<br>
MyType(_default == DefaultType.YES)<br><br>In my java class MyType I have something like this:<br>public class MyType {<br> ....<br> @XmlAttribute(name = "default")<br> protected DefaultType _default;<br>
....<br>}<br><br>where DefaultType is an enum. <br>Here is the hole enum class:<br><br>@XmlType(name = "defaultType")<br>@XmlEnum<br>public enum DefaultType {<br><br> @XmlEnumValue("yes")<br> YES("yes");<br>
private final String value;<br><br> DefaultType(String v) {<br> value = v;<br> }<br><br> public String value() {<br> return value;<br> }<br><br> public static DefaultType fromValue(String v) {<br>
for (DefaultType c: DefaultType.values()) {<br> if (c.value.equals(v)) {<br> return c;<br> }<br> }<br> throw new IllegalArgumentException(v);<br> }<br>}<br><br>
Can you help me? I don't see where the problem is...<br>Any suggestions are much appreciated.<br>
<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>
<br></blockquote></div><br>