<br> Krister,<br><br> Well, the best way to write the rule is indeed without that "or", since it will generate unneeded subrules. To achieve best performance and results would be better to do (using new features from MR3):
<br><br>rule "Buyer neutral"<br>when<br> $c : CallContext(cause == "checkout", state == "new")<br> Order( buyer.prospect == true )<br> Quality( value in ( 1, 2 ) )
<br>then<br> $c.setState("neutral");<br>end<br><br> But what you reported is a problem anyway, so, if you can open a JIRA and attach a test case, I really appreciate. I will look at it and fix as soon as possible.
<br><br> []s<br> Edson<br><br><div><span class="gmail_quote">2007/6/28, Krister Saleck <<a href="mailto:krister.saleck@mytoys.de">krister.saleck@mytoys.de</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,<br><br>thanks for the new features in 4.0MR3 - now i may get rid<br>of some of my workarounds :-)<br><br>Unfortunately one problem still pops up in MR3:<br><br>Some generated code causes a ClassCastException while casting to
<br>a implementation class. Because JBossRules wraps Facts by a generated<br>class implementing the facts interface, there should only be some<br>casting to the interface class?!<br><br>---<br>caused by: java.lang.ClassCastException
: de.myToys.CallContextImpl<br> at<br>de.myToys.konsum.core.account.rules.Rule_Buyer_neutral_0Eval0Invoker.eva<br>luate(<br> Rule_Buyer_neutral_0Eval0Invoker.java:12)<br> at<br>org.drools.rule.EvalCondition.isAllowed
(EvalCondition.java:71)<br>---<br>rule "Buyer neutral"<br> when<br> $c : CallContext(cause == "checkout", state == "new")<br> $order : Order()<br> (Quality(value == 1) or Quality(value == 2))
<br> eval($order.getBuyer().isProspect())<br> then<br> $c.setState("neutral");<br>end<br>---<br><br>If I execute the rule without the "or" term i do not run into<br>
that problem.... bad rule style?<br><br>Did anyone have a hint?<br><br>Thanks in advance,<br>Krister<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>