<!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">
Better still why don't you say why you think it's different. Remember
'or' results in two rules being generate, so write out those two rules
separately and it might help you understand. The second one is just
standard logic. And don't forget you'll get standard cross products
here, i.e. A x B and B x A.<br>
<br>
Mark<br>
Jai Vasanth wrote:
<blockquote
 cite="mid:3e7e19680802061725r5bd72a99p8374234d38e51db1@mail.gmail.com"
 type="cite">Here is the actual reason why I wanted to know the
difference between those 2.<br>
  <br>
  <br>
rule "Remove smaller or non-overriden"<br>
&nbsp;&nbsp;&nbsp; dialect "java"<br>
&nbsp;&nbsp;&nbsp; when<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; L : Response( $r : value &amp;&amp; status != "override" )<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (Response(&nbsp; value &gt; $r ) or Response( status == "override"))<br>
&nbsp;&nbsp;&nbsp; then<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; retract( L );&nbsp;&nbsp;&nbsp; <br>
end<br>
  <br>
The above rule performs what I intended. It retains the Response with
the largest value or it the one that has an override status (if one
exists)<br>
  <br>
But I am getting a different behaviour for this one<br>
  <br>
rule "Remove smaller or non-overriden"<br>
&nbsp;&nbsp;&nbsp; dialect "java"<br>
&nbsp;&nbsp;&nbsp; when<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; L : Response( $r : value &amp;&amp; status != "override" )<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Response(&nbsp; value &gt; $r ||&nbsp; status == "override" )<br>
&nbsp;&nbsp;&nbsp; then<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; retract( L );&nbsp;&nbsp;&nbsp; <br>
end<br>
  <br>
This rule seems to retain both the objects, the overriden and the
largest value<br>
  <br>
Could you explain to me how they are diffrent.<br>
  <br>
Thanks<br>
  <br>
Jai<br>
  <br>
  <br>
  <div class="gmail_quote">On Feb 6, 2008 4:30 PM, Mark Proctor &lt;<a
 moz-do-not-send="true" href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</a>&gt;
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 bgcolor="#ffffff" text="#000000">
One is a field constraint disjointed connected the other is a
Conditional Element 'or'. Details of both are covered in the manual.
Suffice to say the first is like writting if ( stmt1.attrib1 == "X" ||
smt1.attrib1 == "Y" ) whil the ohte results in two separate rules, one
checking "X" and the other checking "Y", both rules can match and fire.<br>
    <br>
Mark<br>
    <br>
Jai Vasanth wrote:
    <blockquote type="cite">
      <div>
      <div class="Wj3C7c">Hi,<br>
      <br>
&nbsp;What is the difference between the following 2 statements<br>
      <br>
      <br>
stmt1 : FactA( attrib1 == "X" ||&nbsp; attrib1 =="Y")&nbsp;&nbsp;&nbsp; <br>
      <br>
      <br>
stmt2: FactA( attrib1 =="X") or FactA(attrib1 =="Y")<br>
      <br>
      <br>
      <br>
Thanks <br>
      <br>
Jai <br>
      </div>
      </div>
      <pre><hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a moz-do-not-send="true" href="mailto:rules-users@lists.jboss.org"
 target="_blank">rules-users@lists.jboss.org</a>
<a moz-do-not-send="true"
 href="https://lists.jboss.org/mailman/listinfo/rules-users"
 target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre>
    </blockquote>
    <br>
    </div>
    <br>
_______________________________________________<br>
rules-users mailing list<br>
    <a moz-do-not-send="true" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
    <a moz-do-not-send="true"
 href="https://lists.jboss.org/mailman/listinfo/rules-users"
 target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
    <br>
  </blockquote>
  </div>
  <br>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
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>
<br>
</body>
</html>