<br> This seems a bug. May I ask you please to open a JIRA for it and attach a self contained test showing the problem?<br><br> At the same time, I think there is a conceptual error in your rules: no object should be changed in the LHS of the rules. This will surely cause you problems in the future, so, I strongly advise you to rethink your rules.
<br><br> []s<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>I am using drool 4.0.1,I am facing some problem in using or operator<br><br> i am using 2 maps by inserting in to working memory:<br>1) ErrorMap<"String","String"><br>2) validationmap<String,Object>
<br><br>my requirment is to generate error when rule fails for this i am taking<br>following steps:<br>1) i insert one entry in error map in when part and if that rule is success<br>2)i remove that entry from map and<br>3) at the end on the basis of this map i generates validation errors.
<br><br><br>import java.util.Map;<br>import com.IValidationField;<br><br>rule "ValueAllowed_G10.3"<br>when<br>IValidationField(attributeId =="G10.3")<br>$map : Map( keySet contains "ErrorMap" )
<br>eval($map.put("G10.3_V","E_V_ALLOWED") == null || true)<br>(or Map( this["G10.2"] not in("5"))<br>Map( this["G10.2"] in("5")))<br>then<br>map.remove("G10.3_V
");<br>System.out.println("comming<br>here----------------------------------------->");<br>end<br><br>this file is giving classcast exception<br><br>org.drools.RuntimeDroolsException: java.lang.ClassCastException
:<br>com.ValidationFieldImpl<br> at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:75)<br> at<br>org.drools.reteoo.EvalConditionNode.assertTuple(EvalConditionNode.java:141)<br> at<br>org.drools.reteoo.SingleTupleSinkAdapter.propagateAssertTuple
(SingleTupleSinkAdapter.java:20)<br> at org.drools.reteoo.JoinNode.assertTuple(JoinNode.java:120)<br><br>but when i replace "or" with "and" operator then it is working fine:<br>import java.util.Map
;<br>import com.IValidationField;<br><br>rule "ValueAllowed_G10.3"<br>when<br>IValidationField(attributeId =="G10.3")<br>$map : Map( keySet contains "ErrorMap" )<br>eval($map.put("G10.3_V
","E_V_ALLOWED") == null || true)<br>(and Map( this["G10.2"] not in("5"))<br>Map( this["G10.2"] in("5")))<br>then<br>map.remove("G10.3_V");<br>System.out.println
("comming<br>here----------------------------------------->");<br>end<br><br><br>--<br>View this message in context: <a href="http://www.nabble.com/Problem-in-using-or-operator-with-values-in-map.-tf4472442.html#a12752031">
http://www.nabble.com/Problem-in-using-or-operator-with-values-in-map.-tf4472442.html#a12752031</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>