<br>&nbsp;&nbsp;&nbsp; Hi,<br><br>&nbsp;&nbsp;&nbsp; First, it would be better if you can use the constraints inside the same pattern, avoiding subrule generation, instead of using multiple patterns:<br><br>Map( this[&quot;G250.18&quot;] !=4 &amp;&amp; this[&quot;
G250.4&quot;] not in(&quot;910&quot;,&quot;990&quot;,&quot;983&quot;,&quot;995&quot;, &quot;996&quot;,&quot;997&quot;) <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; || this[&quot;G250.18&quot;] ==4 &amp;&amp; this[&quot;G250.4&quot;] in (&quot;910&quot;,&quot;990&quot;,&quot;983&quot;,&quot;995&quot;,&quot;996&quot;,&quot;997&quot;) ) 
<br><br>&nbsp;&nbsp;&nbsp; Remember that &amp;&amp; has precedence over ||, but you can use () if you want to make it explicit:<br><br>Map( ( this[&quot;G250.18&quot;] !=4 &amp;&amp; this[&quot;G250.4&quot;] not in(&quot;910&quot;,&quot;990&quot;,&quot;983&quot;,&quot;995&quot;, &quot;996&quot;,&quot;997&quot;) )
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; || ( this[&quot;G250.18&quot;] ==4 &amp;&amp; this[&quot;G250.4&quot;] in (&quot;910&quot;,&quot;990&quot;,&quot;983&quot;,&quot;995&quot;,&quot;996&quot;,&quot;997&quot;) ) ) <br>&nbsp;
<br>&nbsp;&nbsp;&nbsp; Now, answering your question, if you want to negate part of the whole of the LHS, just use the &quot;not&quot; CE. Example:<br><br>rule &quot;ValidationRuleExp_G250.4_0&quot;<br>when<br>&nbsp;&nbsp;&nbsp; not (<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IValidationField(attributeId ==&quot;
G250.4&quot;) and<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Map( this[&quot;G250.18&quot;] !=4 &amp;&amp; this[&quot;G250.4&quot;] not in(&quot;910&quot;,&quot;990&quot;,&quot;983&quot;,&quot;995&quot;, &quot;996&quot;,&quot;997&quot;) <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; || this[&quot;G250.18&quot;] ==4 &amp;&amp; this[&quot;G250.4&quot;] in (&quot;910&quot;,&quot;990&quot;,&quot;983&quot;,&quot;995&quot;,&quot;996&quot;,&quot;997&quot;) ) <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br>then<br>&nbsp;&nbsp;&nbsp; // do something
<br>end<br>
<br>&nbsp;&nbsp;&nbsp; Hope it helps,<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; Edson<br><br><div><span class="gmail_quote">2007/9/18, Gaurav2007 &lt;<a href="mailto:gaurav.a.joshi@capgemini.com">gaurav.a.joshi@capgemini.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Hi All,<br><br>My requirment is that i want to send corresponding error when any rule<br>fails.<br><br>for example:<br><br>rule &quot;ValidationRuleExp_G250.4_0&quot;<br>when<br>IValidationField(attributeId ==&quot;G250.4
&quot;)<br><br>(((Map( this[&quot;G250.18&quot;] !=4))&amp;&amp;(Map( this[&quot;G250.4&quot;]not<br>in(&quot;910&quot;,&quot;990&quot;,&quot;983&quot;,&quot;995&quot;,&quot;996&quot;,&quot;997&quot;))))||((Map( this[&quot;
G250.18&quot;]<br>==4))&amp;&amp;(Map( this[&quot;G250.4&quot;] in(&quot;910&quot;,&quot;990&quot;,&quot;983&quot;,&quot;995&quot;,&quot;996&quot;,&quot;997&quot;)))))<br><br>then<br><br>System.out.println(&quot;comming<br>
here---Success--------------------------------------------------&gt;&quot;);<br>end<br><br>In this case i can call some method in success,Is there any way so that i<br>can call some method when any rule fails.<br><br>the problem is that i am trying to generate rule file and all the validation
<br>expressions are already defined.<br>my task is to evaluate these expression and generate corresponding error<br>message when any rule fails<br><br>can you please suggest me how can i do this using drools.<br><br>Thanks,
<br>Gaurav<br><br><br>--<br>View this message in context: <a href="http://www.nabble.com/how-to-perform-some-task-when-rule-fails.-tf4475301.html#a12760314">http://www.nabble.com/how-to-perform-some-task-when-rule-fails.-tf4475301.html#a12760314
</a><br>Sent from the drools - user mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<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">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli
<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>