<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {margin-right:0in;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle20
        {font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thank you Edson,</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I am not a developer of drools, so I
appreciate your sharing of design decisions here.</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I still wish the “field constraint”
be a field constraint no matter how this field is referenced, be it by name or
by variable that references this field, otherwise it is more like “field
name constraint”</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>So I wish I could do:</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Person( </span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> $a : age,</span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> $minAge : 30,</span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> $maxAge : 40,</span></font></p>
<p class=MsoNormal style='text-indent:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>$a > $minAge && < $maxAge)</span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>The introduction of local variable can be helpful when field names are
complex and long (that is the case I have now), and need to be used more then
once inside of expression. Also using eval involves performance penalty, so I
would like to avoid it wherever possible,</span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Just my 2 cents…</span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>-Sergey</span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <b><span style='font-weight:bold'>On
Behalf Of </span></b>Edson Tirelli<br>
<b><span style='font-weight:bold'>Sent:</span></b> Friday, August 10, 2007 3:17
PM<br>
<b><span style='font-weight:bold'>To:</span></b> Rules Users List<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [rules-users] bug or
feature not yet implemented</span></font></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
Sergey,<br>
<br>
Well, a "field constraint" must always involve a field.
The decision to have it on the left side is to simplify syntax. For instance,
if you want to write something like: "age between 30 and 40", you can
do: <br>
<br>
Person( age > 30 && < 40 )<br>
<br>
So you declare the field only once and can have as many
expressions applied over it as you want, using restriction connectives
(&& and ||).<br>
<br>
Now, if your expression does not involve a field, then it is
not a "field constraint". It may be an "inline-eval"
(previously called predicate expression) for instance. And in this case, you
use the "eval" keyword as showed in my previous example. <br>
Unfortunatelly, to avoid language ambiguities, we can't
support arbitrary expressions without a markup keyword, and "eval"
was the chosen keyword.<br>
<br>
[]s<br>
Edson</span></font></p>
<div>
<p class=MsoNormal><span class=gmailquote><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>2007/8/10, Manukyan, Sergey <<a
href="mailto:SManukyan@lear.com">SManukyan@lear.com</a>>:</span></font></span></p>
<div link=blue vlink=blue>
<div>
<p><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>Thanks Edson for workaround,</span></font></p>
<p><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'> </span></font></p>
<p><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>IMHO that looks like a limitation to me, is there a
particular reason why left side should always be a field?</span></font></p>
<p><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'> </span></font></p>
<p><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>-Sergey</span></font></p>
<p><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'> </span></font></p>
<p><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'> </span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center>
</span></font></div>
<p><b><font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;
font-weight:bold'>From:</span></font></b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'> <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><span style='font-weight:bold'>On Behalf Of </span></b>Edson Tirelli<br>
<b><span style='font-weight:bold'>Sent:</span></b> Friday, August 10, 2007
11:58 AM<br>
<b><span style='font-weight:bold'>To:</span></b> Rules Users List<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [rules-users] bug or
feature not yet implemented</span></font></p>
</div>
<div><span id="q_11450efd22b5835c_1">
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'> </span></font></p>
<p style='margin-bottom:12.0pt'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><br>
Sergey,<br>
<br>
That is how it is supposed to work. A field constraint in Drools
always has a field at its left side. If you want arbitrary expression, just
embed it in an inline eval:<br>
<br>
S : Supplier( <br>
$sts :
supplierBusinessStatus.businessStatus,<br>
$csts : corporateSupplier.supplierBusinessStatus.businessStatus,
<br>
eval ( $sts != $csts ) <br>
) <br>
<br>
Although, for this specific case, it would be better (more
performatic) to simply write:<br>
<br>
S : Supplier(<br>
$sts :
supplierBusinessStatus.businessStatus,<br>
$csts : corporateSupplier.supplierBusinessStatus.businessStatus != $sts<br>
)<br>
<br>
[]s<br>
Edson</span></font></p>
<div>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>2007/8/10,
Manukyan, Sergey <<a href="mailto:SManukyan@lear.com" target="_blank">SManukyan@lear.com
</a>>:</span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'><br>
Folks,<br>
<br>
I found that drools 4.0GA doesn't recognize variables in the left side<br>
of operator expression<br>
<br>
Like this produces error:<br>
<br>
<br>
When<br>
S : Supplier(<br>
$sts :
supplierBusinessStatus.businessStatus ,<br>
$csts
:<br>
corporateSupplier.supplierBusinessStatus.businessStatus,<br>
$sts
!= $csts<br>
)<br>
Then<br>
...<br>
<br>
<br>
<br>
It tries to treat the $sts variable as a field of Supplier, instead <br>
understanding that it is a variable declared earlier,<br>
<br>
Please advise,<br>
<br>
Thanks,<br>
<br>
-Sergey<br>
<br>
<br>
<br>
<br>
**********************<br>
** LEGAL DISCLAIMER **<br>
**********************<br>
<br>
This E-mail message and any attachments may contain <br>
legally privileged, confidential or proprietary<br>
information. If you are not the intended recipient(s),<br>
or the employee or agent responsible for delivery of<br>
this message to the intended recipient(s), you are<br>
hereby notified that any dissemination, distribution<br>
or copying of this E-mail message is strictly<br>
prohibited. If you have received this message in<br>
error, please immediately notify the sender and<br>
delete this E-mail message from your computer. <br>
<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></span></font></p>
</div>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'><br>
<br clear=all>
<br>
-- <br>
Edson Tirelli<br>
Software Engineer - JBoss Rules Core Developer<br>
Office: +55 11 3529-6000<br>
Mobile: +55 11 9287-5646 <br>
JBoss, a division of Red Hat @ <a href="http://www.jboss.com"
target="_blank">www.jboss.com</a> </span></font></p>
</div>
</div>
</div>
</span>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><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></span></font></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br clear=all>
<br>
-- <br>
Edson Tirelli<br>
Software Engineer - JBoss Rules Core Developer<br>
Office: +55 11 3529-6000<br>
Mobile: +55 11 9287-5646 <br>
JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>
</span></font></p>
</div>
</body>
</html>