How would you use a class with private members and no getters in any other Java application?<br><br>If you want the members of the class to influence rules you&#39;re going to have to expose them somehow.<br><br>Even if you set the global at the same time as you set the class&#39;s member you are effectively trying to use globals as a substitute for objects of your class.<br>
<br>If you really, really can&#39;t expose members of the class then perhaps you should:-<br><ul><li>Question why you need to use it in a rule in the first place, or</li></ul><ul><li>Use a Declared Type</li></ul><br><div class="gmail_quote">
On 10 February 2012 10:43, ehmkey <span dir="ltr">&lt;<a href="mailto:ehmkey@gmail.com">ehmkey@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hey all,<br>
<br>
i have a class with private members and no getters. I realized my rules with<br>
the &#39;global&#39; keyword. I read that global isnt good for every case, does a a<br>
better solution exist?<br>
<br>
public class example {<br>
  private int number;<br>
  ..<br>
  ..<br>
}<br>
<br>
*.drl:<br>
package example;<br>
<br>
global int number;<br>
<br>
rule ....<br>
<br>
Thank you!<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/rules-user-problem-with-private-members-no-getters-tp3732106p3732106.html" target="_blank">http://drools.46999.n3.nabble.com/rules-user-problem-with-private-members-no-getters-tp3732106p3732106.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></span></blockquote></div><br>