<br> Steve,<br><br> Only way to do that today is through in-line eval(). <br> 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:<br>
<br><a href="http://anonsvn.labs.jboss.com/labs/jbossrules/branches/4.0.x/drools-core/src/main/java/org/drools/base/evaluators/StringFactory.java">http://anonsvn.labs.jboss.com/labs/jbossrules/branches/4.0.x/drools-core/src/main/java/org/drools/base/evaluators/StringFactory.java</a><br>
<br> And unit tests in this class:<br><br><a href="http://anonsvn.labs.jboss.com/labs/jbossrules/branches/4.0.x/drools-core/src/test/java/org/drools/base/EvaluatorFactoryTest.java">http://anonsvn.labs.jboss.com/labs/jbossrules/branches/4.0.x/drools-core/src/test/java/org/drools/base/EvaluatorFactoryTest.java</a><br>
<br> Everything else should work just fine and then your rules will be able to use <, >, etc directly for String comparisons.<br><br> []s<br> Edson<br><br><br><div class="gmail_quote">2008/5/6 Steve Olson <<a href="mailto:SOlson@ameren.com">SOlson@ameren.com</a>>:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
We've hit a situation where the business users would like to specifiy some<br>
facts that have a range check (a 'between' type operation) on fixed length<br>
strings, that are usually short (6 characters or less). Simple example -<br>
given a range of 'ABC' to 'ABM', this range would match all the character<br>
strings 'ABC', 'ABD', ..., 'ABM'. We quickly discovered the '<' and '>'<br>
operators don't work with strings, and are wondering if others have solved<br>
this problem other ways. Searches have shown some discussions about being<br>
able to build something like a custom StringEvaluator that does support '<'<br>
and '>', but we haven't seen enough to know what would be the best path. If<br>
anyone has suggestions, other than using eval() for all such checks, I'd<br>
appreciate any info.<br>
<br>
Thanks in advance...<br>
<font color="#888888">--<br>
View this message in context: <a href="http://www.nabble.com/String-range-compares-tp17085898p17085898.html" target="_blank">http://www.nabble.com/String-range-compares-tp17085898p17085898.html</a><br>
Sent from the drools - user mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>