<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Someone poppe onto irc a few months back, claiming they did this for
their company and would provide the code as a patch - never heard
anything after that though :(<br>
So if that person is read, please upload your patch to JIRA :)<br>
<br>
Mark<br>
Greg Barton wrote:
<blockquote cite="mid:210359.67494.qm@web81507.mail.mud.yahoo.com"
type="cite">
<pre wrap="">--- On Fri, 9/5/08, Michael Zimmermann <a class="moz-txt-link-rfc2396E" href="mailto:list@incunabulum.de"><list@incunabulum.de></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">rule "MyRule"
when
book(year==myYear, author==myAuthor ...)
then
....
This works only if all properties myYear, myAuthor ... are
present. If one is undefined, the rule does not match.
</pre>
</blockquote>
<pre wrap=""><!---->
You could have a function that returns true if the properties match or the property is null:
boolean matchesOrNull(Object o, Object p) {
return p == null ? true : ( o == null ? true : o.equals(p) );
}
Call it using eval in the conditions.
Maybe if it's useful enough an operator could be added to Drools that does the same thing. "~=" maybe?
GreG
_______________________________________________
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>
<br>
</body>
</html>