<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1589" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=198501619-20032007>Sounds
right.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=198501619-20032007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=198501619-20032007>Thanks,</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=198501619-20032007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=198501619-20032007>Tom
G</SPAN></FONT></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> rules-dev-bounces@lists.jboss.org
[mailto:rules-dev-bounces@lists.jboss.org] <B>On Behalf Of </B>Michael
Neale<BR><B>Sent:</B> Saturday, March 17, 2007 7:25 PM<BR><B>To:</B> Rules Dev
List<BR><B>Subject:</B> Re: [rules-dev] need advice re null
handling<BR></FONT><BR></DIV>
<DIV></DIV>well, with nulls, it only makes sense if you have knowledge that a
given field is NOT a primitive, which is clearly something that only the
developer would know.<BR><BR>So basically, from what I am hearing, because we
transparently allow primitives, null should not be treated specially, other then
for equality. Dealing with specific inequality for example: <BR><BR>Foo(field !=
3) could be true if field is null. However, Foo(field <, contains, >
etcc....) will ALWAYS be false if field is null. The only thing that could be
true when a field is null is equality, or not equals. <BR>I will add some more
tests for this.<BR><BR>
<DIV><SPAN class=gmail_quote>On 3/17/07, <B class=gmail_sendername>Felipe
Piccolini</B> <<A
href="mailto:felipe.piccolini@bluesoft.cl">felipe.piccolini@bluesoft.cl</A> >
wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>As I see it, this is not like SQL, because Tom said "<SPAN> <FONT
face=Arial color=#0000ff size=2><SPAN style="FONT-SIZE: 10px">null is returned
when an access fails or some error occurs"<FONT face=Helvetica color=#000000
size=3><SPAN style="FONT-SIZE: 12px">, but then the guy
</SPAN></FONT></SPAN></FONT></SPAN>
<DIV>who prepare the SQL statements has to be acknowloedge of the meaning of a
null return, so he writes the querys in a</DIV>
<DIV>correct way to the application. Here thats not the case, the guy who
writes the rules doesn't need to know why that </DIV>
<DIV>field is null, or 0 or blank, he ask for a statement of truth (field !=
3), he spect not reason why that field is not 3, maybe </DIV>
<DIV>the value of the field is 0,1,2,4,5... null, " ", or whatever another
value possible, he is just asking to not be specific one. </DIV>
<DIV>If someone need to manage the null value in a diferent way, then he must
prepare the Fact Objects, Value Objects, Pojos,</DIV>
<DIV>Wrappers in a diferent way, design to do what he wants to be done with
null values but not at the rules language level. </DIV>
<DIV><BR></DIV>
<DIV>If I wanna ask for null value in a field to check for errors for example,
I should ask for that " Fact( field == null )".</DIV>
<DIV><BR></DIV>
<DIV>Maybe it could be a parametric flag somewhere telling the engine how to
manage nulls, and set a default... </DIV>
<DIV><BR></DIV>
<DIV>Another question: How the engine manage to return to Fact( field == null)
when field is a primitive?, it makes autoboxing?,</DIV>
<DIV>comaparing Integer (for int) to null or something like that?, if the
Engine do so, why?, maybe the rule's writer was wrong when </DIV>
<DIV>he wrote that, or maybe he just wanted to check if the field is
blank/zero/not setter/etc... </DIV>
<DIV><SPAN class=e id=q_1115b5c34d14575b_1>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV>
<DIV>
<DIV>On 15-03-2007, at 20:23, Michael Neale wrote: </DIV><BR>
<BLOCKQUOTE type="cite">Felipe - yes that is consistent.<BR><BR>But what
about:<BR><BR>Fact( field != 3 )<BR>now if field is null, its certainly not
equal to 3, but should this be true? or because of null, it is always false?
<BR><BR>In SQL, it would always be false. <BR><BR>
<DIV><SPAN class=gmail_quote>On 3/16/07, <B class=gmail_sendername>Felipe
Piccolini</B> <<A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:felipe.piccolini@bluesoft.cl" target=_blank>
felipe.piccolini@bluesoft.cl</A>> wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>I think Im not agree with that... the question here is about how the
Rule languaje will treat an expresion
<DIV>made by a businness agent to the rules... so when a rule has a
condition writen like this:</DIV>
<DIV> Fact( field > 3)</DIV>
<DIV> this is asking : Is there a fact of type Fact which has a
field and the value of that value is greater that 3.. </DIV>
<DIV><BR></DIV>
<DIV>So, if the Fact actually exists and for 'some reason' its field
"field" has a value which is not greater than 3 </DIV>
<DIV>(the rule doesn't need to know why the value is not 3, or is 0,
or null or whatever) then the condition must </DIV>
<DIV>return (or been evaluated as) false. Its responsability for the DAO
or fill implementation of the fact to put the </DIV>
<DIV>right value on its fields, the values that MEAN something. If its
null it is possible that the value was never </DIV>
<DIV>setted or initialized, or maybe it means something else. If a
bussiness guy wants to ask for been null </DIV>
<DIV> Fact( field == null) </DIV>
<DIV>then that question is a meaningfull one, dont let programmers decide
what it means. If I wanna to ask for </DIV>
<DIV>being greater that 3, and it has no value, then the answer is NO, "it
is NO greather than 3". </DIV>
<DIV><BR></DIV>
<DIV>well... this is just my humile opinion btw....</DIV>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV>
<DIV><SPAN><BR>
<DIV>
<DIV>On 15-03-2007, at 13:03, Tom Gonzalez wrote:</DIV><BR>
<BLOCKQUOTE type="cite">
<DIV><FONT face=Arial color=#0000ff size=2><SPAN>We handle it as it
can't be anything else but null cause null is returned when an access
fails or some error occurs. This keeps it from falling into a valid
evaluation and possibly a subtle bug going uncaught.
</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff
size=2><SPAN></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN>Tom
G</SPAN></FONT></DIV><BR>
<DIV lang=en-us dir=ltr align=left>
<HR>
<FONT face=Tahoma size=2><B>From:</B> <A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:rules-dev-bounces@lists.jboss.org"
target=_blank>rules-dev-bounces@lists.jboss.org</A> [<A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:rules-dev-bounces@lists.jboss.org" target=_blank>
mailto:rules-dev-bounces@lists.jboss.org</A>] <B>On Behalf Of </B>Mark
Proctor<BR><B>Sent:</B> Thursday, March 15, 2007 12:42 PM<BR><B>To:</B>
Rules Dev List<BR><B>Subject:</B> Re: [rules-dev] need advice re null
handling <BR></FONT><BR></DIV>
<DIV></DIV>Its not about giving it up, its how we handle when those
fields are null, do we treat it like a primitive and assume its 0, or do
we say it can't be equal to anything else but null.<BR><BR>In the
following example neither y or z is defined, thus y is null and z is
0;<BR><BR>int x = 0;<BR>Integer y;<BR>in z;<BR>x == y // is false;<BR>x
== z // is true<BR>y == null // is true<BR><BR>Mark<BR><BR>Tom Gonzalez
wrote:
<BLOCKQUOTE type="cite">
<DIV><SPAN><FONT face=Arial color=#0000ff size=2>The flexibility
provided by an Object is very valuable. We use Integer and String
objects all over the place today in our facts with drools. I
would hate to give it up. </FONT></SPAN></DIV>
<DIV><SPAN></SPAN> </DIV>
<DIV><SPAN><FONT face=Arial color=#0000ff size=2>Tom
G</FONT></SPAN></DIV><BR>
<DIV lang=en-us dir=ltr align=left>
<HR>
<FONT face=Tahoma size=2><B>From: </B><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:rules-dev-bounces@lists.jboss.org"
target=_blank>rules-dev-bounces@lists.jboss.org</A> [<A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:rules-dev-bounces@lists.jboss.org" target=_blank>
mailto:rules-dev-bounces@lists.jboss.org</A>] <B>On Behalf Of </B>Mark
Proctor<BR><B>Sent:</B> Thursday, March 15, 2007 6:29 AM<BR><B>To:</B>
Rules Dev List<BR><B>Subject:</B> Re: [rules-dev] need advice re null
handling <BR></FONT><BR></DIV>if bar is an integer it will be 0, if
its an Integer it will be null. The Q is do we make Integer work like
the primitive, or do we make it work like an
Object.<BR><BR>Mark<BR>Michael Neale wrote:
<BLOCKQUOTE type="cite"><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://jira.jboss.com/jira/browse/JBRULES-627"
target=_blank>http://jira.jboss.com/jira/browse/JBRULES-627</A><BR><BR>OK,
this much is clear: <BR><BR>Foo(field == null) can be true if field
is null.<BR><BR>but, what about Foo(field > 3), and field is
null? should that be false? what about Foo(field != 3) - should that
be true? <BR><BR>in SQL, null will always result in a false
condition, unless you explicitly use null. <BR><BR>Thoughts?
<BR><BR>Michael.<BR><PRE><HR width="90%" SIZE=4>_______________________________________________<BR>rules-dev mailing list<BR><A onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-dev@lists.jboss.org" target=_blank>
rules-dev@lists.jboss.org</A>
<A onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-dev" target=_blank>https://lists.jboss.org/mailman/listinfo/rules-dev</A>
</PRE></BLOCKQUOTE><BR><PRE><HR width="90%" SIZE=4>_______________________________________________<BR>rules-dev mailing list<BR><A onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-dev@lists.jboss.org" target=_blank>
rules-dev@lists.jboss.org</A>
<A onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-dev" target=_blank>https://lists.jboss.org/mailman/listinfo/rules-dev</A>
</PRE></BLOCKQUOTE><BR>
<DIV
style="MARGIN: 0px">_______________________________________________</DIV>
<DIV style="MARGIN: 0px">rules-dev mailing list</DIV>
<DIV style="MARGIN: 0px"><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:rules-dev@lists.jboss.org"
target=_blank>rules-dev@lists.jboss.org</A></DIV>
<DIV style="MARGIN: 0px"><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="https://lists.jboss.org/mailman/listinfo/rules-dev"
target=_blank>https://lists.jboss.org/mailman/listinfo/rules-dev
</A></DIV></BLOCKQUOTE></DIV><BR></SPAN></DIV>
<DIV><SPAN
style="WORD-SPACING: 0px; FONT: 12px Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; border-spacing: 0px">
<DIV><SPAN style="TEXT-DECORATION: underline"><SPAN>
</SPAN></SPAN>
<DIV><FONT size=3><SPAN style="FONT-SIZE: 13px"><B
style="FONT-WEIGHT: bold; FONT-SIZE: 13px"><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 13px">Felipe Piccolini
M.</SPAN></B></SPAN></FONT></DIV>
<DIV><A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:felipe.piccolini@bluesoft.cl" target=_blank><SPAN
style="COLOR: rgb(0,0,238)">felipe.piccolini@bluesoft.cl</SPAN></A></DIV><BR></DIV>
<DIV><BR></DIV><BR></SPAN></DIV><BR></DIV></DIV><BR>_______________________________________________<BR>rules-dev
mailing list<BR><A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:rules-dev@lists.jboss.org"
target=_blank>rules-dev@lists.jboss.org</A><BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="https://lists.jboss.org/mailman/listinfo/rules-dev"
target=_blank>https://lists.jboss.org/mailman/listinfo/rules-dev</A><BR><BR></BLOCKQUOTE></DIV><BR>
<DIV
style="MARGIN: 0px">_______________________________________________</DIV>
<DIV style="MARGIN: 0px">rules-dev mailing list</DIV>
<DIV style="MARGIN: 0px"><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:rules-dev@lists.jboss.org"
target=_blank>rules-dev@lists.jboss.org</A></DIV>
<DIV style="MARGIN: 0px"><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="https://lists.jboss.org/mailman/listinfo/rules-dev"
target=_blank>https://lists.jboss.org/mailman/listinfo/rules-dev</A></DIV></BLOCKQUOTE></DIV><BR>
<DIV><SPAN
style="WORD-SPACING: 0px; FONT: 12px Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; border-spacing: 0px">
<DIV><SPAN style="TEXT-DECORATION: underline"><SPAN>
</SPAN></SPAN>
<DIV><FONT size=3><SPAN style="FONT-SIZE: 13px"><B
style="FONT-WEIGHT: bold; FONT-SIZE: 13px"><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 13px">Felipe Piccolini
M.</SPAN></B></SPAN></FONT></DIV>
<DIV><A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:felipe.piccolini@bluesoft.cl" target=_blank><SPAN
style="COLOR: rgb(0,0,238)">felipe.piccolini@bluesoft.cl</SPAN></A></DIV><BR></DIV>
<DIV><BR></DIV><BR></SPAN></DIV><BR></DIV></SPAN></DIV></DIV><BR>_______________________________________________<BR>rules-dev
mailing list <BR><A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</A><BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="https://lists.jboss.org/mailman/listinfo/rules-dev"
target=_blank>https://lists.jboss.org/mailman/listinfo/rules-dev</A><BR><BR></BLOCKQUOTE></DIV><BR></BODY></HTML>