<br> Hi,<br><br> 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["G250.18"] !=4 && this["
G250.4"] not in("910","990","983","995", "996","997") <br> || this["G250.18"] ==4 && this["G250.4"] in ("910","990","983","995","996","997") )
<br><br> Remember that && has precedence over ||, but you can use () if you want to make it explicit:<br><br>Map( ( this["G250.18"] !=4 && this["G250.4"] not in("910","990","983","995", "996","997") )
<br>
|| ( this["G250.18"] ==4 && this["G250.4"] in ("910","990","983","995","996","997") ) ) <br>
<br> Now, answering your question, if you want to negate part of the whole of the LHS, just use the "not" CE. Example:<br><br>rule "ValidationRuleExp_G250.4_0"<br>when<br> not (<br> IValidationField(attributeId =="
G250.4") and<br> Map( this["G250.18"] !=4 && this["G250.4"] not in("910","990","983","995", "996","997") <br>
|| this["G250.18"] ==4 && this["G250.4"] in ("910","990","983","995","996","997") ) <br> )<br>then<br> // do something
<br>end<br>
<br> Hope it helps,<br> <br> Edson<br><br><div><span class="gmail_quote">2007/9/18, Gaurav2007 <<a href="mailto:gaurav.a.joshi@capgemini.com">gaurav.a.joshi@capgemini.com</a>>:</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 "ValidationRuleExp_G250.4_0"<br>when<br>IValidationField(attributeId =="G250.4
")<br><br>(((Map( this["G250.18"] !=4))&&(Map( this["G250.4"]not<br>in("910","990","983","995","996","997"))))||((Map( this["
G250.18"]<br>==4))&&(Map( this["G250.4"] in("910","990","983","995","996","997")))))<br><br>then<br><br>System.out.println("comming<br>
here---Success-------------------------------------------------->");<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> Edson Tirelli
<br> Software Engineer - JBoss Rules Core Developer<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>