Well, accesses to embedded objects are a little more complicated, but if you want it:<br><br>rule HomeWinEt<br> when<br> $f : Fact( $d : details )<br> eval( $d.CLOCK_STAGE > 10 &&<br> ($d.HOME_MATCH_SCORE - $d.HOME_FULL_TIME_SCORE ><br>
$d.AWAY_MATCH_SCORE - $d.AWAY_FULL_TIME_SCORE))<br> then<br> # ...<br>end<br><br>Consider asserting the objects stored as the Facts.details as well. This will let you write the much more declarative (and presumably more efficient) rule with the "return value" restriction:<br>
<br>rule HomeWinEtxxx<br> when<br> $d : Detail( CLOCK_STAGE > 10,<br> HOME_MATCH_SCORE > (HOME_FULL_TIME_SCORE + AWAY_MATCH_SCORE - AWAY_FULL_TIME_SCORE))<br> $f : Fact( details == $d )<br>
then<br> # ...<br>end<br><br>-W<br><br><br><br><br><div class="gmail_quote">2009/3/20 Zevenbergen, Alex <span dir="ltr"><<a href="mailto:azevenbergen@paddypower.com">azevenbergen@paddypower.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Thanks,</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">this is the rule:</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff">
<p><font color="#ff0000" face="Arial" size="2">rule "Home win et" </font></p>
<p><font color="#ff0000" face="Arial" size="2">when</font></p>
<p><font color="#ff0000" face="Arial" size="2">$f : Fact(details.CLOCK_STAGE >
10,<span>(</span>details.HOME_MATCH_SCORE -
details.HOME_FULL_TIME_SCORE<span>)</span>
> <span>(</span>details.AWAY_MATCH_SCORE -
details.AWAY_FULL_TIME_SCORE<span>)</span>)</font></p>
<p><font color="#ff0000" face="Arial" size="2">then</font></p>
<p>
</p><p><font color="#ff0000" face="Arial" size="2"></font></p><font color="#ff0000" face="Arial" size="2">end</font></font></span></div><br>
<div dir="ltr" align="left" lang="en-us">
<hr>
<font face="Tahoma" size="2"><b>From:</b> <a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>
[mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>] <b>On Behalf Of </b>Wolfgang
Laun<br><b>Sent:</b> 20 March 2009 09:15<br><b>To:</b> Rules Users
List<br><b>Subject:</b> Re: [rules-users] Logic in the when
clause<br></font><br></div><div><div></div><div class="h5">
<div></div>You could use eval( <expression> ) for this, but I guess it
could also be added as a return value field constraint to the last of these four
fields. Would you mind providing the full pattern?<br>-W<br><br>
<div class="gmail_quote">2009/3/20 Zevenbergen, Alex <span dir="ltr"><<a href="mailto:azevenbergen@paddypower.com" target="_blank">azevenbergen@paddypower.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div><font face="Arial" size="2"><span>Hi,</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>quick newbie question about the when clause
in a rule. eg can i get the fact to be tested from the result of two other
inputted facts?</span></font></div>
<div><font size="-0"><span><font color="#ff0000" face="Arial" size="2"></font></span></font> </div>
<div><font size="-0"><span><font color="#ff0000" face="Arial" size="2">details.HOME_MATCH_SCORE - details.HOME_FULL_TIME_SCORE >
details.AWAY_MATCH_SCORE -
details.AWAY_FULL_TIME_SCORE</font></span></font></div>
<div>
<p><span><font face="Arial" size="2">I assumed this would work fine but it doesn't
recognise the '-' as a minus!</font></span></p>
<p><span><font face="Arial" size="2">Thanks in advance</font></span></p>
<p><span><font face="Arial" size="2">Alex</font></span></p></div>
<div><font face="Arial" size="2"></font> </div><br>________________________________________________________________________<br>Privileged,
confidential and/or copyright information may be contained in this
communication. This e-mail and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to whom they are
addressed. If you are not the intended addressee, you may not copy, forward,
disclose or otherwise use this e-mail or any part of it in any way whatsoever.
To do so is prohibited and may be unlawful. If you have received this email in
error <br>please notify the sender immediately.<br><br>Paddy Power PLC may
monitor the content of e-mail sent and received for the purpose of ensuring
compliance with its policies and procedures.<br><br>Paddy Power plc, Airton
House, Airton Road, Tallaght, Dublin 24 Registered in Ireland:
16956<br>________________________________________________________________________<br></div><br>_______________________________________________<br>rules-users
mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br><a 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>
<br>
________________________________________________________________________<br>
Privileged, confidential and/or copyright information may be contained in this communication. This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended addressee, you may not copy, forward, disclose or otherwise use this e-mail or any part of it in any way whatsoever. To do so is prohibited and may be unlawful. If you have received this email in error <br>
please notify the sender immediately.<br>
<br>
Paddy Power PLC may monitor the content of e-mail sent and received for the purpose of ensuring compliance with its policies and procedures.<br>
<br>
Paddy Power plc, Airton House, Airton Road, Tallaght, Dublin 24 Registered in Ireland: 16956<br>
________________________________________________________________________<br>
</div></div></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a 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>