<div><br></div>   In 5.2 this is supposed to work just fine:<div><br></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); "> CDRRecords</span><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); ">( calledNumber.startsWith(&quot;011&quot;) )</span></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><br></font></div><div><font class="Apple-style-span" face="arial, sans-serif">   Edson<br></font><br><div class="gmail_quote">2011/8/8 Mattias Nilsson Grip <span dir="ltr">&lt;<a href="mailto:mattias.nilsson.grip@redpill-linpro.com">mattias.nilsson.grip@redpill-linpro.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
aftab wrote:<br>
&gt;<br>
&gt; I want to define rules for below function,<br>
&gt;<br>
&gt;   private boolean isFixedNumber(Call call){<br>
&gt;<br>
&gt;       if(call.getCalledNumber().startsWith(&quot;01&quot;) ||<br>
&gt; call.getCalledNumber().startsWith(&quot;02&quot;) ||<br>
&gt;              call.getCalledNumber().startsWith(&quot;03&quot;) ){<br>
&gt;              return true;<br>
&gt;          }<br>
&gt;       else{<br>
&gt;           return false;<br>
&gt;       }<br>
&gt;   }<br>
&gt;<br>
&gt; Give some hints how can i define it  ?<br>
&gt; I was trying to define it in below format,<br>
&gt; rule &quot;Is Fixed Number&quot;<br>
&gt; dialect &quot;java&quot;<br>
&gt;       when c : CDRRecords<br>
&gt;         (calledNumber.startsWith( &quot;011&quot;) )<br>
&gt;       then<br>
&gt;               c.setFixedNetNumber(true);<br>
&gt;               System.out.println(&quot;c.setFixedNetNumber (true) &quot;); // consequence<br>
&gt;<br>
&gt; end<br>
&gt;<br>
&gt;<br>
&gt; Thanks in advance for your support ...<br>
&gt;<br>
If you&#39;re using Drools 5.2 you should be able to do:<br>
<br>
c : CDRRecords( calledNumber str[startsWith] &quot;011&quot; )<br>
<br>
If you are on earlier version of Drools you can match with a regular<br>
expression:<br>
<br>
c : CDRRecords( calledNumber matches &quot;011.*&quot; )<br>
<br>
/Mattias<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/startsWith-function-tp3228735p3234795.html" target="_blank">http://drools.46999.n3.nabble.com/startsWith-function-tp3228735p3234795.html</a><br>
Sent from the Drools: User forum mailing list archive at Nabble.com.<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>  JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>
</div>