<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3020" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=097375414-21022007><FONT face=Arial
color=#0000ff size=2>Yes, but I don't think that the cases below apply to my
test.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=097375414-21022007><FONT face=Arial
color=#0000ff size=2>All my facts have a default constructor and they doesn't
use the final keyword. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=097375414-21022007><FONT face=Arial
color=#0000ff size=2>The native data types are used in the LHS only
(boolean an integer types) in this way for example:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=097375414-21022007><FONT size=2>
<P>$allarme : AllarmeMisura(aggregated==</FONT><B><FONT color=#960000
size=2>false</B></FONT><FONT size=2>, networkState==</FONT><FONT color=#008000
size=2>"Open"</FONT><FONT size=2>)</P></FONT></SPAN></DIV>
<DIV><SPAN class=097375414-21022007></SPAN><FONT face=Arial color=#0000ff
size=2>which i thi<SPAN class=097375414-21022007>nk is allowed
(right?). </SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=097375414-21022007></SPAN></FONT><FONT><SPAN
class=097375414-21022007></SPAN><SPAN class=097375414-21022007></SPAN><FONT
face=Arial color=#0000ff size=2>T<SPAN class=097375414-21022007>he base error is
a class cast exception it seems:</SPAN></FONT></FONT></DIV><FONT><FONT
color=#0000ff><SPAN class=097375414-21022007></SPAN><U><FONT color=#000080>
<P align=left><FONT face=Arial
size=2>java.lang.ClassCastException</FONT></U></FONT><FONT color=#ff0000><FONT
face=Arial size=2>:
it.telecomitalia.netbox.AggregatedAlarmShadowProxy</FONT></P>
<P align=left><FONT face=Arial size=2>at
org.drools.base.it.telecomitalia.netbox.AllarmeTf$getReferencedElement.getValue(Unknown
Source)</FONT></P>
<P align=left><FONT face=Arial size=2>at
org.drools.base.ClassFieldExtractor.getValue(</FONT></FONT><U><FONT
color=#000080><FONT face=Arial
size=2>ClassFieldExtractor.java:79</FONT></U></FONT><FONT color=#ff0000><FONT
face=Arial size=2>)</FONT></P>
<P align=left><FONT face=Arial size=2>at
org.drools.rule.Declaration.getValue(</FONT></FONT><U><FONT color=#000080><FONT
face=Arial size=2>Declaration.java:156</FONT></U></FONT><FONT
color=#ff0000><FONT face=Arial size=2>)</FONT></P>
<P align=left><FONT face=Arial size=2>at
it.telecomitalia.netbox.Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0Predicate0Invoker.evaluate(</FONT></FONT><U><FONT
color=#000080><FONT face=Arial
size=2>Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0Predicate0Invoker.java:14</FONT></U></FONT><FONT
color=#ff0000><FONT face=Arial size=2>)</FONT></P>
<P><FONT face=Arial size=2>at
org.drools.rule.PredicateConstraint.isAllowedCachedRight(</FONT></FONT><U><FONT
color=#000080><FONT face=Arial
size=2>PredicateConstraint.java:190</FONT></U></FONT><FONT color=#ff0000><FONT
face=Arial size=2>)</FONT></P></FONT>
<DIV><FONT face=Arial size=2></FONT><BR><SPAN class=097375414-21022007><FONT
face=Arial size=2>AggregatedAlarm is the base class of AllarmeTf, and the LHS of
the rule </FONT><FONT size=2><FONT face=Arial><FONT color=#008000>"Nuovo Allarme
Misura No Allarme Oggetto"<SPAN class=097375414-21022007>
</SPAN></FONT></FONT><FONT face=Arial>that gives an exception is
this:</FONT></FONT></SPAN></DIV><SPAN class=097375414-21022007><FONT size=2>
<P align=left><FONT color=#000000>$allarme :
AllarmeMisura(aggregated==</FONT></FONT><B><FONT color=#960000
size=2>false</B></FONT><FONT color=#000000 size=2>, networkState==</FONT><FONT
color=#008000 size=2>"Open"</FONT><FONT size=2><FONT color=#000000>)</FONT></P>
<P></FONT><B><FONT color=#960000 size=2>not</B></FONT><FONT size=2> <FONT
color=#000000>AllarmeTf( $tfAllarme :referencedElement ->(
$tfAllarme.equals($allarme.getReferencedElement().getReferencedTf())))</FONT></FONT></P></FONT></FONT>
<DIV><FONT face=Arial><FONT size=2><FONT color=#0000ff><SPAN
class=097375414-21022007>To me it seem ok.....</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><FONT color=#0000ff><SPAN
class=097375414-21022007></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2><FONT color=#0000ff><SPAN
class=097375414-21022007>Am I doing something
wrong?</SPAN></FONT></FONT></FONT></DIV><FONT><FONT color=#0000ff>
<P><FONT size=2><FONT face=Arial></FONT> </P></FONT></SPAN></FONT></FONT>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=it dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>Da:</B> rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <B>Per conto di </B>Mark
Proctor<BR><B>Inviato:</B> mercoledì 21 febbraio 2007 15.41<BR><B>A:</B> Rules
Users List<BR><B>Oggetto:</B> Re: [rules-users] Is 3.1 M1 backward
compatible?<BR></FONT><BR></DIV>
<DIV></DIV>The syntax is backwards compatible. However as the release notes
mention we no longer autobox primitives, as you can now work directly with
them, which will cause issues in old drls that assumed numbers are
wrapped. Also pojos must have a default constructor and not use the final
keyword at the class and method level - we are actively looking to add more
flexability to this case.<BR><BR>Mark<BR>Dandrea Francesco wrote:
<BLOCKQUOTE
cite=mid:48C49CA807312F4C9C5C1DCE87632E35FF9B51@PTPEVS109RM001.idc.cww.telecomitalia.it
type="cite"><PRE wrap="">Hi all,
the attached example runs ok (slow but ok) on JBoss Rules 3.0.5
Now when I run it with 3.1M1 I have an exception (I pasted it at the end
of the mail).
Is 3.1 M1 backward compatible? Is this a bug? Should I change the code
in some way?
Thanks a lot
org.drools.RuntimeDroolsException: Exception executing predicate
it.telecomitalia.netbox.Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0Pr
edicate0Invoker@60bd060e
at
org.drools.rule.PredicateConstraint.isAllowedCachedRight(PredicateConstr
aint.java:196)
at
org.drools.common.SingleBetaConstraints.isAllowedCachedRight(SingleBetaC
onstraints.java:111)
at org.drools.reteoo.NotNode.assertObject(NotNode.java:149)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(Compo
siteObjectSinkAdapter.java:313)
at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:163)
at org.drools.reteoo.Rete.assertObject(Rete.java:121)
at
org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:196)
at
org.drools.reteoo.ReteooWorkingMemory.doAssertObject(ReteooWorkingMemory
.java:68)
at
org.drools.common.AbstractWorkingMemory.assertObject(AbstractWorkingMemo
ry.java:724)
at
org.drools.base.DefaultKnowledgeHelper.assertObject(DefaultKnowledgeHelp
er.java:72)
at
org.drools.base.DefaultKnowledgeHelper.assertObject(DefaultKnowledgeHelp
er.java:66)
at
it.telecomitalia.netbox.Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0.c
onsequence(Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0.java:17)
at
it.telecomitalia.netbox.Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0Co
nsequenceInvoker.evaluate(Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0
ConsequenceInvoker.java:22)
at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:467)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:431)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemo
ry.java:360)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemo
ry.java:341)
at
it.telecomitalia.netbox.MainProvaClass.fireRuleEngineProva(MainProvaClas
s.java:85)
at it.telecomitalia.netbox.MainProvaClass.main(MainProvaClass.java:23)
Caused by: java.lang.ClassCastException:
it.telecomitalia.netbox.AggregatedAlarmShadowProxy
at
org.drools.base.it.telecomitalia.netbox.AllarmeTf$getReferencedElement.g
etValue(Unknown Source)
at
org.drools.base.ClassFieldExtractor.getValue(ClassFieldExtractor.java:79
)
at org.drools.rule.Declaration.getValue(Declaration.java:156)
at
it.telecomitalia.netbox.Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0Pr
edicate0Invoker.evaluate(Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0P
redicate0Invoker.java:14)
at
org.drools.rule.PredicateConstraint.isAllowedCachedRight(PredicateConstr
aint.java:190)
... 18 more
org.drools.RuntimeDroolsException: Exception executing predicate
it.telecomitalia.netbox.Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0Pr
edicate0Invoker@60bd060e
at
org.drools.rule.PredicateConstraint.isAllowedCachedRight(PredicateConstr
aint.java:196)
at
org.drools.common.SingleBetaConstraints.isAllowedCachedRight(SingleBetaC
onstraints.java:111)
at org.drools.reteoo.NotNode.assertObject(NotNode.java:149)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(Compo
siteObjectSinkAdapter.java:313)
at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:163)
at org.drools.reteoo.Rete.assertObject(Rete.java:121)
at
org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:196)
at
org.drools.reteoo.ReteooWorkingMemory.doAssertObject(ReteooWorkingMemory
.java:68)
at
org.drools.common.AbstractWorkingMemory.assertObject(AbstractWorkingMemo
ry.java:724)
at
org.drools.base.DefaultKnowledgeHelper.assertObject(DefaultKnowledgeHelp
er.java:72)
at
org.drools.base.DefaultKnowledgeHelper.assertObject(DefaultKnowledgeHelp
er.java:66)
at
it.telecomitalia.netbox.Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0.c
onsequence(Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0.java:17)
at
it.telecomitalia.netbox.Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0Co
nsequenceInvoker.evaluate(Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0
ConsequenceInvoker.java:22)
at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:467)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:431)
at
org.drools.common.AbstractWorkingMemory.doOtherwise(AbstractWorkingMemor
y.java:384)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemo
ry.java:366)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemo
ry.java:341)
at
it.telecomitalia.netbox.MainProvaClass.fireRuleEngineProva(MainProvaClas
s.java:85)
at it.telecomitalia.netbox.MainProvaClass.main(MainProvaClass.java:23)
Caused by: java.lang.ClassCastException:
it.telecomitalia.netbox.AggregatedAlarmShadowProxy
at
org.drools.base.it.telecomitalia.netbox.AllarmeTf$getReferencedElement.g
etValue(Unknown Source)
at
org.drools.base.ClassFieldExtractor.getValue(ClassFieldExtractor.java:79
)
at org.drools.rule.Declaration.getValue(Declaration.java:156)
at
it.telecomitalia.netbox.Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0Pr
edicate0Invoker.evaluate(Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0P
redicate0Invoker.java:14)
at
org.drools.rule.PredicateConstraint.isAllowedCachedRight(PredicateConstr
aint.java:190)
... 19 more
org.drools.spi.ConsequenceException: org.drools.RuntimeDroolsException:
Exception executing predicate
it.telecomitalia.netbox.Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0Pr
edicate0Invoker@60bd060e
at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:471)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:431)
at
org.drools.common.AbstractWorkingMemory.doOtherwise(AbstractWorkingMemor
y.java:384)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemo
ry.java:366)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemo
ry.java:341)
at
it.telecomitalia.netbox.MainProvaClass.fireRuleEngineProva(MainProvaClas
s.java:85)
at it.telecomitalia.netbox.MainProvaClass.main(MainProvaClass.java:23)
Caused by: org.drools.RuntimeDroolsException: Exception executing
predicate
it.telecomitalia.netbox.Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0Pr
edicate0Invoker@60bd060e
at
org.drools.rule.PredicateConstraint.isAllowedCachedRight(PredicateConstr
aint.java:196)
at
org.drools.common.SingleBetaConstraints.isAllowedCachedRight(SingleBetaC
onstraints.java:111)
at org.drools.reteoo.NotNode.assertObject(NotNode.java:149)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(Compo
siteObjectSinkAdapter.java:313)
at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:163)
at org.drools.reteoo.Rete.assertObject(Rete.java:121)
at
org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:196)
at
org.drools.reteoo.ReteooWorkingMemory.doAssertObject(ReteooWorkingMemory
.java:68)
at
org.drools.common.AbstractWorkingMemory.assertObject(AbstractWorkingMemo
ry.java:724)
at
org.drools.base.DefaultKnowledgeHelper.assertObject(DefaultKnowledgeHelp
er.java:72)
at
org.drools.base.DefaultKnowledgeHelper.assertObject(DefaultKnowledgeHelp
er.java:66)
at
it.telecomitalia.netbox.Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0.c
onsequence(Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0.java:17)
at
it.telecomitalia.netbox.Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0Co
nsequenceInvoker.evaluate(Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0
ConsequenceInvoker.java:22)
at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:467)
... 6 more
Caused by: java.lang.ClassCastException:
it.telecomitalia.netbox.AggregatedAlarmShadowProxy
at
org.drools.base.it.telecomitalia.netbox.AllarmeTf$getReferencedElement.g
etValue(Unknown Source)
at
org.drools.base.ClassFieldExtractor.getValue(ClassFieldExtractor.java:79
)
at org.drools.rule.Declaration.getValue(Declaration.java:156)
at
it.telecomitalia.netbox.Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0Pr
edicate0Invoker.evaluate(Rule_Nuovo_Allarme_Misura_No_Allarme_Oggetto_0P
redicate0Invoker.java:14)
at
org.drools.rule.PredicateConstraint.isAllowedCachedRight(PredicateConstr
aint.java:190)
... 19 more
--------------------------------------------------------------------
CONFIDENTIALITY NOTICE
This message and its attachments are addressed solely to the persons above and may contain confidential information. If you have received the message in error, be informed that any use of the content hereof is prohibited. Please return it immediately to the sender and delete the message. Should you have any questions, please contact us by replying to <A class=moz-txt-link-abbreviated href="mailto:webmaster@telecomitalia.it">webmaster@telecomitalia.it</A>.
Thank you
<A class=moz-txt-link-abbreviated href="http://www.telecomitalia.it">www.telecomitalia.it</A>
--------------------------------------------------------------------
</PRE><PRE wrap=""><HR width="90%" SIZE=4>
_______________________________________________
rules-users mailing list
<A class=moz-txt-link-abbreviated href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</A>
<A class=moz-txt-link-freetext href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</A>
</PRE></BLOCKQUOTE><BR></BLOCKQUOTE><DIV><FONT size=2><FONT
face="Courier New">--------------------------------------------------------------------<BR>CONFIDENTIALITY
NOTICE<BR>This message and its attachments are addressed solely to the
persons<BR>above and may contain confidential information. If you have
received<BR>the message in error, be informed that any use of the content
hereof<BR>is prohibited. Please return it immediately to the sender and
delete<BR>the message. Should you have any questions, please contact us
by<BR>replying to </FONT><A href="mailto:webmaster@telecomitalia.it"><FONT
face="Courier New">webmaster@telecomitalia.it</FONT></A><FONT
face="Courier New">.<BR> Thank
you<BR>
</FONT><A href="http://www.telecomitalia.it"><FONT
face="Courier New">www.telecomitalia.it</FONT></A><BR><FONT
face="Courier New">--------------------------------------------------------------------</FONT></FONT></DIV>
</BODY></HTML>