<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
We are thinking of extending the java dialect with a modify command
that works like the mvel one; this would negate the need to use a
separate modify statement. Just a matter of getting time to do it :(<br>
<br>
Mark<br>
ekke wrote:
<blockquote cite="mid:13954697.post@talk.nabble.com" type="cite">
  <pre wrap="">mehdi,

the rules engine has to know that your fact changed,
you can use PropertyChangeSupport
take a look at the documentation
2.5.4.4. Update
2.5.4.7. Property Change Listener
6.5.3. The Right Hand Side (then)

regards
ekke

Mehdi-6 wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">hi,

I have a class Customer.java with class variable "allTradeAmounts" and

I have two rules as follows:

rule "rule 1"
    when
        $c : Customer();
    then 
             
        $c.setAllTradeAmounts($c.getAllTradeAmounts().add(1000));   
       System.out.println("after modify: "+$c.getAllTradeAmounts());
end

rule "rule 2"
    when
        $c : Customer(allTradeAmounts &lt; 200 );
    then
        System.out.println("AllTradeAmounts &lt; 200 ");

end

The rule 1 works fine and changes the value of this variable.
My question is, although the rule 1 has changed the class variable and I
can see the result of changed variable EACH TIME, when i insert a Customer
object, why is the second rule TRUE? I have changed the value of
AllTradeAmounts and I can print it in RHS and it is more than 200, but in
LHS if I check with "allTradeAmounts &lt; 200 " ,it is true.
It must be FALSE and does not fire the rule.
can someone help me? what do I do wrong in LHS.
In the same rule (rule 2) if I print the allTradeAmounts it is more than
200.
sorry it is a simple question, but I m new to drools.
Thanks and regards  
       
---------------------------------
Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try
it now.
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>


    </pre>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
</blockquote>
<br>
</body>
</html>