You&#39;re right, if you want to do this with 2 facts, you&#39;ll need to do :<br><br>
 &nbsp; $test : Test( $y : y )<br>
 &nbsp; Test( <br><div style="margin-left: 40px;">this == $test,<br></div><div style="margin-left: 40px;">x == ($y + 1) )<br><br></div>Chris<br><br><div class="gmail_quote">2008/5/2 Raffi Khatchadourian &lt;<a href="mailto:khatchad@cse.ohio-state.edu">khatchad@cse.ohio-state.edu</a>&gt;:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">On Fri &nbsp;2.May&#39;08 at 10:05:20 +0100, Anstis, Michael (M.) wrote:<br>
</div><div class="Ih2E3d"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
The &quot;when&quot; section matches fact (object) patterns, so your requirement<br>
could be written as:-<br>
<br>
when there is a Test Fact &#39;A&#39; and another Test Fact &#39;B&#39; where &quot;the &#39;x&#39;<br>
property of &#39;A&#39;&quot; equals &quot;the &#39;y&#39; property of fact &#39;B&#39; plus 1&quot; then.....<br>
<br>
This would become:-<br>
<br>
rule &quot;Rule 1&quot;<br>
when<br>
 &nbsp; Test( $y : y )<br>
 &nbsp; Test( x == ($y + 1) )<br>
</blockquote>
<br></div>
Actually, please correct me if I am mistaken, but is this condition<br>
correct? I believe that the original question is that for a single<br>
instance of class Test t, fire the rule when t.x == t.y + 1 (where &#39;t&#39;<br>
refers to the *same* instance of class Test). I believe the rule above<br>
would match any instance of class Test whose x value is equal to the<br>
value of the instance field y from *any* instance of class Test plus 1.<br>
Does that make sense?<br>
_______________________________________________<br>
rules-users mailing list<div class="Ih2E3d"><br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
</div><div><div></div><div class="Wj3C7c"><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br>