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 :(
So if that person is read, please upload your patch to JIRA :)
Mark
Greg Barton wrote:
--- On Fri, 9/5/08, Michael Zimmermann <list(a)incunabulum.de>
wrote:
> 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.
>
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
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users