<!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">
    <br>
    You are right; your probably need to set a no-loop atttribute on
    your rule. <br>
    Or, preferably, put additional conditions to the LHS of your
    FirstRule (it would probably be the case in a "real-life" rule).<br>
    As Wolfgang suggested, take some time to read Drools expert
    documentation: I found it very well designed for beginners (like
    me).<br>
    <br>
    Regards,<br>
    <br>
    Bruno.<br>
    <br>
    Le 12/05/2011 11:19, Nico ROEDERER a &eacute;crit&nbsp;:
    <blockquote cite="mid:4DCBA639.9000305@gmail.com" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <font size="-1">Ok, but when I did this, the first rule has no
        ending.<br>
        If I don't want to, I've got to retract the object, but my
        second rule is never fired.<br>
        <br>
        Should I make two different files ?<br>
        <br>
        Thanks for the help.<br>
        (Sorry for such a poor English writing :( )<br>
        <br>
      </font>Le 12/05/2011 11:12, Bruno Freudensprung a &eacute;crit&nbsp;:
      <blockquote cite="mid:4DCBA46A.80407@temis.com" type="cite">
        <meta content="text/html; charset=ISO-8859-1"
          http-equiv="Content-Type">
        <br>
        Hi,<br>
        <br>
        In my understanding it is normal. However if you told Drools
        that your FirstRule modified the $testDrools object, it should
        no longer be the case:<br>
        <br>
        <tt>&nbsp; then<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Set my value to 1");<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $testDrools.setMyValue("1");<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; update($testDrools);<br>
        </tt><br>
        Regards,<br>
        <br>
        Bruno.<br>
        <br>
        <br>
        Le 12/05/2011 10:58, Nico ROEDERER a &eacute;crit&nbsp;:
        <blockquote cite="mid:4DCBA148.9010101@gmail.com" type="cite">
          <meta http-equiv="content-type" content="text/html;
            charset=ISO-8859-1">
          <font size="-1">Hi,<br>
            <br>
            I've got a little question. I've got a drl file which
            contains two rules :<br>
            <br>
            rule "FirstRule"<br>
            &nbsp;&nbsp;&nbsp; salience 99<br>
            &nbsp;&nbsp;&nbsp; when<br>
            &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $testDrools : TestDroolsDto()&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
            &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; eval ( 1 == 1 )<br>
            &nbsp;&nbsp;&nbsp; then <br>
            &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println("Set my value to 1");<br>
            &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $testDrools.setMyValue("1");<br>
            &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
            end<br>
            <br>
            rule "SecondRule"<br>
            &nbsp;&nbsp;&nbsp; salience 1<br>
            &nbsp;&nbsp;&nbsp; when<br>
            &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $testDrools : TestDroolsDto()&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
            &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; eval( $testDrools.getMyValue().equals("") )<br>
            &nbsp;&nbsp;&nbsp; then <br>
            &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println("My Value : " +
            $testDrools.getMyValue() );<br>
            end<br>
            <br>
            Is it normal that in my second rule is verified ? <br>
            -&gt; </font><font size="-1"> eval(
            $testDrools.getMyValue().equals("") ) is true<br>
            but : </font><font size="-1"> System.out.println("My Value
            : " + $testDrools.getMyValue() ); show me that myValue == 1
            <br>
            <br>
            Perhaps I did something wrong ?<br>
            <br>
            Thanks for your helping me.<br>
            N.<br>
            <br>
          </font><font size="-1"><br>
            <br>
            PS : Here is me TestDroolsDto :<br>
            public class TestDroolsDto {<br>
            &nbsp;&nbsp;&nbsp; private String myValue;<br>
            <br>
            &nbsp;&nbsp;&nbsp; public TestDroolsDto() {<br>
            &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; myValue="";<br>
            &nbsp;&nbsp;&nbsp; }<br>
            &nbsp;&nbsp;&nbsp; <br>
            &nbsp;&nbsp;&nbsp; public String toString() {<br>
            &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return " --&gt; " + myValue;<br>
            &nbsp;&nbsp;&nbsp; }<br>
            &nbsp;&nbsp;&nbsp; <br>
            &nbsp;&nbsp;&nbsp; /**<br>
            &nbsp;&nbsp;&nbsp; * @return the myValue<br>
            &nbsp;&nbsp;&nbsp; */<br>
            &nbsp;&nbsp; public String getMyValue() {<br>
            &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ( myValue == null ) {<br>
            &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; myValue = "";<br>
            &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
            &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return myValue;<br>
            &nbsp;&nbsp; }<br>
            <br>
            &nbsp;&nbsp;&nbsp; /**<br>
            &nbsp;&nbsp;&nbsp; * @param myValue the myValue to set<br>
            &nbsp;&nbsp;&nbsp; */<br>
            &nbsp;&nbsp; public void setMyValue( String myValue ) {<br>
            &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; this.myValue = myValue;<br>
            &nbsp;&nbsp; }<br>
            }<br>
            <br>
          </font>
          <pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rules-users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a moz-do-not-send="true" 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>
        <br>
      </blockquote>
    </blockquote>
    <br>
  </body>
</html>