<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">


<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@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:0cm;
        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:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:1054232824;
        mso-list-type:hybrid;
        mso-list-template-ids:2092054266 67698699 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:\F0D8;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;
        mso-fareast-font-family:"Times New Roman";
        mso-bidi-font-family:"Times New Roman";}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Also, since everything in
rules needs to be an Object, is there any plan to make the operators deal with
said Objects? That is, so I do not always have to de-reference with my eval or
predicate objects with intValue() or floatValue() or whatever?&nbsp; <br>
<br>
<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Not a DROOLS expert, but from what I understand this is already
possible now as long as you are using Java 1.5 (which has
autoboxing/autounboxing as part of the language spec).<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Vlad<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>&nbsp;</span></font><o:p></o:p></p>

</div>

<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 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>Justine Hlista<br>
<b><span style='font-weight:bold'>Sent:</span></b> 08 February 2007 15:12<br>
<b><span style='font-weight:bold'>To:</span></b> rules-users@lists.jboss.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> [rules-users] Parse bug
in predicate constraints?</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Should predicate
constraints be sensitive to whitespace?? I have the following rule with a
predicate constraint:<br>
rule &quot;test&quot;<br>
&nbsp;&nbsp;&nbsp; when<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; valObj : MyValuesObject(a:aVal,
b:bVal, c:cVal -&gt; ((a.intValue() &lt;&nbsp; (1/780) * (b.intValue() +
c.intValue()) &amp;&amp; (b.intValue() + c.intValue()) &gt; 500000)<br>
&nbsp; &nbsp; then<br>
&nbsp; &nbsp; &nbsp; &nbsp; System.out.println(&quot;Alert condition met on
obj:&quot; + valObj);<br>
end<br>
<br>
Inserting whitespace into the predicate results in the following exception:<br>
<br>
org.drools.rule.InvalidRulePackage: unknown:155:85 mismatched token:
[@1723,5226:5227='\r\n',&lt;4&gt;,155:85]; expecting type ')'<br>
unknown:156:28 mismatched token: [@1752,5256:5256='(',&lt;23&gt;,156:28];
expecting type ')'<br>
<br>
If instead I use an eval on the LHS, I can insert whitespace without an
exception.<br>
<br>
In addition, I would like to know if there are any plans to simplify the syntax
for similar types of rules, as the above is extremely unwieldy for the
non-expert. <br>
For instance, I would vastly prefer to write the following: <br>
<br>
rule &quot;test&quot;<br>
&nbsp;&nbsp;&nbsp; when<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; valObj : MyValuesObject(a:aVal, b:bVal,
c:cVal)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (a &lt; (1/780)*(b+c))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((b + c) &gt; 500000)<br>
&nbsp;&nbsp;&nbsp; then<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(&quot;Alert
condition met on obj:&quot; + valObj); <br>
end<br>
<br>
<br>
Also, since everything in rules needs to be an Object, is there any plan to
make the operators deal with said Objects? That is, so I do not always have to
de-reference with my eval or predicate objects with intValue() or floatValue()
or whatever?&nbsp; <br>
<br>
In our application, the user (i.e. not a drools or java expert) will be writing
the rules. The current syntax requirements for encoding the above simple rule
makes me very nervous about our users ever being able to use the rules
effectively. <br>
<br>
Thanks,<br>
Justine<br>
<br>
<br>
<br>
<br>
<o:p></o:p></span></font></p>

</div>

</body>

</html>