The code you have posted suggests to me that you do something like<br>   A a = new A();<br>   kSession.insert( a );<br>   a.setAge( 28 );<br>   kSession.fireAllRules();<br><br>Complete the object before you insert it or call update after the modification.<br>
<br>-W<br><br><br><div class="gmail_quote">On 1 August 2011 10:04, gbelin <span dir="ltr">&lt;<a href="mailto:gbelin_saiz@hotmail.com">gbelin_saiz@hotmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I have a problem with int data in drools.<br>
<br>
I have created a test class for persons with it setters and getters:<br>
<br>
/public class A {<br>
<br>
        private int age;<br>
        private String sex;<br>
        private String name;<br>
<br>
        public A () {<br>
                System.out.println (&quot;creating A.&quot;);<br>
        }/<br>
<br>
I have a rule that gets the person with de min age<br>
<br>
<br>
/rule &quot;min age&quot;<br>
        ruleflow-group &#39;group1&#39;<br>
        salience 10<br>
        when<br>
                $a : A ()<br>
                not A (age&lt;$a.age)<br>
        then<br>
                System.out.println (&quot;  *** the min age &quot;+$a.getAge()+&quot; corresponds to &quot; +<br>
$a.getName());<br>
end<br>
/<br>
<br>
<br>
I insert 4 persons in the knowledge base with different ages, then, when I<br>
run the rule, it returns all the 4 persons.<br>
<br>
If I set another rule with more priority that sets the ages of all persons,<br>
then the &quot;min age&quot; rule works propertly and write the message for the person<br>
with de minimun age.<br>
<br>
/rule &quot;set age&quot;<br>
        ruleflow-group &#39;group1&#39;<br>
        salience 11<br>
        no-loop<br>
        when<br>
                $a : A ()<br>
        then<br>
                $a.setAge($a.getAge());<br>
                update($a);<br>
                System.out.println( &quot;Person &quot; + $a.getName() + &quot; has an age of &quot; +<br>
$a.getAge() + &quot; years&quot; );<br>
end<br>
/<br>
<br>
<br>
Is there any problem with drools and ints?<br>
<br>
Thanks in advance.<br>
<font color="#888888"><br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/java-int-problem-tp3215383p3215383.html" target="_blank">http://drools.46999.n3.nabble.com/java-int-problem-tp3215383p3215383.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>