<div>Thanks for replay Chri.</div>
<div>&nbsp;</div>
<div>in present&nbsp;product is writting rules validating fields related to table.In this case i writting diff rules.like this is length rule it&#39;s working ...</div>
<div>&nbsp;</div>
<div>rule &quot;name.lengthRule:[insert][update][ui]&quot;</div>
<div>&nbsp;when <br>&nbsp;&nbsp;There is an Category<br>&nbsp;&nbsp;Category name length is greater than 8<br>&nbsp;&nbsp;//CategoryBean($catid:catid,$name:name,$descn:descn) <br>&nbsp; //CategoryBean(name != null, eval(name.length() &gt; 8) )<br>&nbsp; then<br>&nbsp;&nbsp;Reject with response : &quot;name length must be less than 8&quot;</div>

<div>//ruleViolationMap.put(drools.getRule().getName(),&quot;name length must be less than 80&quot;); if(!isSuppressMode){ drools.halt(); }<br>end</div>
<div><br>&nbsp;&nbsp;now i am trying write diff rules like email,zipcode,credit card....</div>
<div>&nbsp; i am trying to use regular expressions.In this case negativeTestCases also Build Success.like this...suppose&nbsp;i am&nbsp;set in to the value like ..</div>
<div>bean.setEmail(&quot;@chnati&quot;);</div>
<div>in this cases actuly Build failure in our testcases.But,this time also Build Success.</div>
<div><br>[*][]Order email address checking for first letter= OrderBean(email&nbsp;matches &quot;@[A-Za-z0-9]*&quot;)</div>
<div>&nbsp;</div>
<div>If any possiable give me the related code email,zipcode,phone number.ASAP... <br></div>
<div class="gmail_quote">On Fri, May 30, 2008 at 2:15 PM, Christine &lt;<a href="mailto:christine@christine.nl">christine@christine.nl</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Chanti,<br>what exactly is your question?<br>I think that checking zipcode and credit card formats is easier to do in<br>
java than with rules. Rules are more efficient in more complex situations,<br>like when you have multiple objects that need to meet various conditions.<br><br>Christine<br>
<div>
<div></div>
<div class="Wj3C7c"><br><br>On Fri, May 30, 2008 09:24, Nagaraju runkana wrote:<br>&gt; HI Guys,<br>&gt;<br>&gt; present i am using drools 4.0 in this case.now, i am writting some rules<br>&gt; validation using regular expression ZIPCODE,EMAIL,CREDIT CARD number.like<br>
&gt; this..<br>&gt; --------------------<br>&gt; validation.dslr<br>&gt; --------------------<br>&gt; rule &quot;email.mandatory:[insert][update][ui]&quot;<br>&gt; &nbsp;when<br>&gt; &nbsp; There is an Order<br>&gt; &nbsp; Order email address checking for first letter<br>
&gt; then<br>&gt; &nbsp;Reject with response : &quot;email address must not start with @ &quot;<br>&gt; end<br>&gt; rule &quot;phone.mandatory:[insert][update][ui]&quot;<br>&gt; when<br>&gt; &nbsp;There is an Order<br>&gt; &nbsp;Order phone number format should checking<br>
&gt; &nbsp;then<br>&gt; &nbsp;Reject with response : &quot;The phone number you entered is not valid.Please<br>&gt; enter a phone number with the format xxx-xxx-xxxx.&quot;\<br>&gt; end<br>&gt; -----------------------<br>&gt; validation.dsl<br>
&gt; --------------------<br>&gt; [*][]Order email address checking for first letter= OrderBean(email<br>&gt; matches<br>&gt; &quot;@[A-Za-z0-9]*&quot;)<br>&gt; [*][]Order phone number format should checking=OrderBean( phone not<br>
&gt; matches<br>&gt; &quot;(/\d{3}\-\d{3}\-\d{4}/)==-1)&quot;)<br>&gt; this rules are not working ...any one can help me.ASAP<br>&gt;<br>&gt; thanks,<br>&gt; chanti<br></div></div>&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br><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>
</blockquote></div><br>