On Tue, Sep 29, 2009 at 12:43 AM, Dave Schweisguth <span dir="ltr">&lt;<a href="mailto:dave@schweisguth.org">dave@schweisguth.org</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Greetings fellow Droolers,<br>
<br>
I&#39;ve just begun using Drools and am very happy with it so far as it seems to<br>
be a great fit for what we want to do. My left hand sides are not quite<br>
beautiful enough, however, and I wondered if anyone could suggest<br>
improvements.<br>
<br>
1) One of my facts&#39; properties is a set of strings. The goal is to &quot;grep&quot;<br>
   them for some search string. The most convenient syntax I&#39;ve come up with<br>
   so far is to give the fact a method anyTextContains which loops over the<br>
   set and calls contains(searchString) on each member, and then use<br>
<br>
fact: Fact() eval(fact.anyTextContains(&quot;searchString&quot;))<br>
<br>
in my LHS. It&#39;s compact enough, but I wondered whether it could be done<br>
without a custom method or eval. &quot;from&quot; seems not to be a possibility since<br>
the collection is of strings, not objects. Any suggestions?<br></blockquote><div><br>But any java.lang.String is an Object, although without a field (in the usual sense),<br>Nevertheless, try<br><br>rule &quot;Match John&quot;<br>
     when<br>         Vote( $names : names ) // Set&lt;String&gt; names<br>         String( this matches &quot;John&quot; ) from $names<br>     then         <br>         System.out.println( &quot;Hi John&quot; );<br>end<br>
 </div>-W<br><br></div><br>