<br> If the string you are looking for is a substring of your sentence, you need to either use a regexp or an eval to call for an indexOf-like method:<br><br>WrapperClass( sentence matches ".*Alpha.*" )<br><br>
[]s<br> Edson<br><br><div class="gmail_quote">2009/5/31 Armaghan Mahmud <span dir="ltr"><<a href="mailto:mahmud.armaghan@gmail.com">mahmud.armaghan@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Hey guys,</div>
<div> </div>
<div>I read in a previous post that == in Drools 4.0.7 maps to .equals() automatically. My situation required me to put a String object into the working memory and do a comparison on it to see if a particular word is in the passed String sentence. Could anybody please guide me as to how to approach this problem? Thanks in advance. Here's my original code:</div>
<div> </div>
<div><font size="2">
<p align="left">rule "Find Alpha in a sentence"</p><u>
<p align="left">salience</p></u> 100
<p>wrap: WrapperClass(Sentence == "Alpha")</p>
<p align="left">then </p>
<p>System.out.<u>println</u>("Aha found ya!");</p>
<p>end</p>
<p> </p>
<p> </p></font></div>
<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>
<br></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>