Forwarded from drools-dev.<br><br>Based upon the single rule you show it is difficult to determine whether the issue you report is caused elsewhere.<br><br>Some general comments however:-<br><ul><li>It is essential to include an &quot;update(<font size="-1">$patient);&quot; in your RHS if the rule engine is to see the change in Patient properties in other rules.</font></li>
</ul><font size="-1"></font><ul><li><font size="-1">How many instances of Patient to you have in WM? Rules will activate for each instance that match patterns.</font></li></ul><font size="-1"></font><br><div class="gmail_quote">
---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Nico ROEDERER</b> <span dir="ltr">&lt;<a href="mailto:ino.nicolas@gmail.com">ino.nicolas@gmail.com</a>&gt;</span><br>Date: 1 March 2011 09:15<br>
Subject: Re: [rules-dev] eval problem<br>To: Rules Dev List &lt;<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>&gt;<br><br><br>

  
    
  
  <div text="#000000" bgcolor="#ffffff">
    <font size="-1">(1) -&gt; yes because when I print the value, the
      value is correct ( = 2 ). Not the eval.<br>
      (2) -&gt; yes, true. My list is in alphabtic mode...<br>
      (3) -&gt; Every test I make made the wrong result <br>
    </font><font size="-1"><br>
      eval( $patient.getNbFactRisque() == 0)<br>
      or </font><font size="-1"> $patient : PatientDto( nbFactRisque ==
      0 </font><font size="-1">)</font> ...<br>
    <small>---&gt; Why does those test are true dispite nbFactRisque = 2
      ????</small><br>
    <br>
    <b><font size="-1">It works fine when I run x time drools (one call
        for one rule) but it doesn&#39;t work when I run one time with a
        List of rules.</font></b><br>
    <br>
    <small>Can you tell me the right mailing list for those problems ?</small><br>
    <br>
    <br>
    Le 01/03/2011 10:03, Wolfgang Laun a écrit :
    <div><div></div><div class="h5"><blockquote type="cite">Please do not use this list for simple questions - it
      is reserved for discussion Drools development itself.<br>
      <br>
      (1) Did you inform the Drools engine about incrementing <font size="-1">nbFactRisque?<br>
        (2) There is no such thing as &quot;alphabetic mode&quot; for rule
        execution.<br>
        (3) Why do you use eval when you can test the fact field?<br>
        <br>
        Indication: Drools Expert manual, three times per day ;-)<br>
        -W<br>
      </font><br>
      <br>
      <div class="gmail_quote">On 1 March 2011 09:17, Nico ROEDERER <span dir="ltr">&lt;<a href="mailto:ino.nicolas@gmail.com" target="_blank">ino.nicolas@gmail.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;">
          <div text="#000000" bgcolor="#ffffff"> <font size="-1">Hi,<br>
              <br>
              I&#39;ve got an other problem with an eval function. <br>
              I will try to discribe the path to the error.<br>
              <br>
              I&#39;ve got a repository where some people can put rules with
              .drl extension.<br>
              My program is listing this repository and execute every
              rule in this repository.<br>
              <br>
              At the begining, I&#39;ve got a &#39;PatientDto&#39; who have a
              property :<br>
              int nbFactRisque;<br>
              (with getters and setters)<br>
              <br>
              Some rules increments this number.<br>
              <br>
              In the last rule (the rules are executed in alphabetic
              mode) I&#39;m testing this number like this :<br>
              <br>
              rule &quot;RisqueNormal&quot;<br>
                  when<br>
                      $patient : PatientDto()<br>
                      eval( $patient.getNbFactRisque() == 0)<br>
                  then <br>
                      $patient.addDonnees( Constants.CLE_RISQUEPATIENT,
              Constants.RISQUE_NORMAL );<br>
                      System.out.println(&quot;RisqueNormal vérifié.&quot; +
              $patient.getNbFactRisque() + &quot;Facteurs.&quot;);<br>
              end<br>
              <br>
              Here&#39;s my problem :<br>
              The &#39;Then&#39; traitement is always executed so the eval
              always think that </font><font size="-1">$patient.getNbFactRisque()
              is equal to 0.<br>
              But the system.out.println() show me that </font><font size="-1"> $patient.getNbFactRisque()  = 2 !<br>
              <br>
            </font><font size="-1">Here&#39;s the output : &quot;RisqueNormal
              vérifié.2Facteurs.&quot;. <br>
              <br>
              Perhaps I did something wrong ? Can someone help me ?<br>
              Thank you.<br>
            </font> </div>
          <br>
          _______________________________________________<br>
          rules-dev mailing list<br>
          <a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a><br>
          <a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
          <br>
        </blockquote>
      </div>
      <br>
      <pre><fieldset></fieldset>
_______________________________________________
rules-dev mailing list
<a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
</pre>
    </blockquote>
  </div></div></div>

<br>_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
<br></div><br>