Only way to do that today is through in-line eval().
Although it is quite easy to add such support to drools, in case you want
to help providing us a patch. Probably 3-4 hours work. Just a matter of
adding the operator support in this class:
And unit tests in this class:
Everything else should work just fine and then your rules will be able to
use <, >, etc directly for String comparisons.
2008/5/6 Steve Olson <SOlson(a)ameren.com>:
We've hit a situation where the business users would like to specifiy some
facts that have a range check (a 'between' type operation) on fixed length
strings, that are usually short (6 characters or less). Simple example -
given a range of 'ABC' to 'ABM', this range would match all the
strings 'ABC', 'ABD', ..., 'ABM'. We quickly discovered the
'<' and '>'
operators don't work with strings, and are wondering if others have solved
this problem other ways. Searches have shown some discussions about being
able to build something like a custom StringEvaluator that does support
and '>', but we haven't seen enough to know what would be the best path.
anyone has suggestions, other than using eval() for all such checks, I'd
appreciate any info.
Thanks in advance...
View this message in context:
Sent from the drools - user mailing list archive at Nabble.com
rules-users mailing list
JBoss Drools Core Development
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com