What version of Drools are you using? <br><br>AFAIK what you have done should work.<br><br><div class="gmail_quote">2011/8/17 Neel <span dir="ltr">&lt;<a href="mailto:neeleshdev@yahoo.co.in">neeleshdev@yahoo.co.in</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font:inherit" valign="top">Hi,<div>I&#39;ve following class defined:</div>
<div><p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Monaco"><span style="color:#a10067">public</span> <span style="color:#a10067">class</span> User {</p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Monaco"><span style="white-space:pre-wrap">        </span><span style="color:#a10067">private</span> String <span style="color:#2700ce">id</span>;</p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Monaco;min-height:15.0px"><span style="white-space:pre-wrap">        </span>//get,set, equals &amp; hashCode method are defined</p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Monaco">}</p><p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Monaco"></p><p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Monaco"><br></p><p></p><p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Monaco">
If I add more attributes using declare syntax as below:</p><span style="font-family:Monaco;font-size:11px"><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">declare User</p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
    name : String</p></span><p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Monaco">end</p><p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Monaco"><br></p><p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Monaco">
it gives error &quot;Error
 creating field accessors for &#39;User&#39; for type &#39;User&#39;&quot;. Is there a way, more attributes can be added in existing class using declare syntax? </p><p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Monaco">
<br></p><p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Monaco">Alternatively, if a class is created by using only declare syntax, can we add equals/hasCode methods dynamically?</p><p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Monaco">
<br></p><p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Monaco">Thanks &amp; Regards,</p><p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Monaco">Neel</p></div></td></tr></tbody></table><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>