<br>&nbsp;&nbsp; Steve,<br><br>&nbsp;&nbsp; Only way to do that today is through in-line eval(). <br>&nbsp;&nbsp; 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>&nbsp;&nbsp;&nbsp; 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>&nbsp;&nbsp; Everything else should work just fine and then your rules will be able to use &lt;, &gt;, etc directly for String comparisons.<br><br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br><br><br><div class="gmail_quote">2008/5/6 Steve Olson &lt;<a href="mailto:SOlson@ameren.com">SOlson@ameren.com</a>&gt;:<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&#39;ve hit a situation where the business users would like to specifiy some<br>
facts that have a range check (a &#39;between&#39; type operation) on fixed length<br>
strings, that are usually short (6 characters or less). &nbsp;Simple example -<br>
given a range of &#39;ABC&#39; to &#39;ABM&#39;, this range would match all the character<br>
strings &#39;ABC&#39;, &#39;ABD&#39;, ..., &#39;ABM&#39;. &nbsp;We quickly discovered the &#39;&lt;&#39; and &#39;&gt;&#39;<br>
operators don&#39;t work with strings, and are wondering if others have solved<br>
this problem other ways. &nbsp;Searches have shown some discussions about being<br>
able to build something like a custom StringEvaluator that does support &#39;&lt;&#39;<br>
and &#39;&gt;&#39;, but we haven&#39;t seen enough to know what would be the best path. &nbsp;If<br>
anyone has suggestions, other than using eval() for all such checks, I&#39;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>