<!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">
I think it would be like this:<br>
<br>
rule "Test" <br>
when <br>
$ca: CoApplicant()<br>
$co: Contract()<br>
eval ( $c1.getRelationship().equals("S") || <br>
$co.getState().equals("CO") || <br>
$co.getState().equals("IL") ))<br>
then<br>
... <br>
I am no expert but you also might be able to achieve what you want a
little more efficiently with a global that ensures the consequence only
executes once:<br>
<br>
global boolean flag = true;<br>
rule "Test" <br>
when <br>
(CoApplicant( relationship == "S" ) or (Contract (
state in ("CO", "IL"))))<br>
eval( flag )<br>
then<br>
flag = false;<br>
... <br>
<br>
<a class="moz-txt-link-abbreviated" href="mailto:kfs2@chryslerfinancial.com">kfs2@chryslerfinancial.com</a> [1/16/2009 11:35 AM] wrote:
<blockquote
cite="mid:OF442031F9.0C294D82-ON85257540.005B1612-85257540.005B0CC1@wkamerica.notes.chrysler.com"
type="cite"><br>
<font face="Courier New" size="2">I understand that as this rule is
written
below it will be compiled into 2 subrules which both fire. I searched
the archives and found a post where Mark Proctor suggested "</font><tt><font
size="3">Bind
each pattern, and do the || field constraints in an eval.". I'm new
to Drools, can someone elaborate on how I would do that with the rule
below?</font></tt>
<br>
<br>
<font face="Courier New" size="2">rule "Test"
</font>
<br>
<font face="Courier New" size="2"> when
</font>
<br>
<font face="Courier New" size="2">
(CoApplicant( relationship == "S"
) or (Contract ( state in ("CO", "IL"))))</font>
<br>
<font face="Courier New" size="2"> then
</font><br>
<font face="sans-serif" size="2"> ...</font>
<br>
<br>
<font face="sans-serif" size="2">Thanks</font>
<br>
<br>
<font face="sans-serif" size="2">Kent </font>
<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>
</body>
</html>