This is related to the problem in your other e-mail and it is fixed in trunk.

   Edson

2010/4/21 Piotr Jedrychowski <pjedrychowski@proximetry.pl>
Hello.

I have a problem with such scenario:

1) add one knowledge package (sensor200) with two rules:

package sensor200
rule "Sensor-200-ON"
when
(and f0: FMSensorFact(id==201) f1: FMSensorFact(id==202) )
(not FMFact(id==200))
then
FMFact factToInsert = new FMFact(200);
insert(factToInsert);
end

package sensor200
rule "Sensor-200-OFF"
when
not (and FMSensorFact(id==201) FMSensorFact(id==202) )
(factToRetract : FMFact(id==200))
then
retract(factToRetract);
end

2) remove knowledge package (sensor200)

3) add knowledge package with the same name as in point 1, but with
other rule:

package sensor200
rule "Sensor-200-OR-201-ON"
when
fact: FMSensorFact(id==201)
(not FMFact(id==200))
then
FMFact factToInsert = new FMFact(200);
insert(factToInsert);
end

During adding knowledge package in point 3, I'm getting
ClassCastException with this Stacktarce:

java.lang.ClassCastException: org.drools.util.ObjectHashMap
 at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:142)
 at org.drools.reteoo.ObjectTypeNode.updateSink(ObjectTypeNode.java:252)
 at org.drools.reteoo.AlphaNode.attach(AlphaNode.java:133)
 at org.drools.reteoo.builder.BuildUtils.attachNode(BuildUtils.java:160)
 at
org.drools.reteoo.builder.PatternBuilder.attachAlphaNodes(PatternBuilder.java:295)
 at
org.drools.reteoo.builder.PatternBuilder.attachPattern(PatternBuilder.java:117)
 at org.drools.reteoo.builder.PatternBuilder.build(PatternBuilder.java:70)
 at
org.drools.reteoo.builder.GroupElementBuilder$NotBuilder.build(GroupElementBuilder.java:228)
 at
org.drools.reteoo.builder.GroupElementBuilder.build(GroupElementBuilder.java:73)
 at
org.drools.reteoo.builder.GroupElementBuilder$AndBuilder.build(GroupElementBuilder.java:126)
 at
org.drools.reteoo.builder.GroupElementBuilder.build(GroupElementBuilder.java:73)
 at
org.drools.reteoo.builder.ReteooRuleBuilder.addSubRule(ReteooRuleBuilder.java:153)
 at
org.drools.reteoo.builder.ReteooRuleBuilder.addRule(ReteooRuleBuilder.java:126)
 at org.drools.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:117)
 at org.drools.reteoo.ReteooRuleBase.addRule(ReteooRuleBase.java:362)
 at org.drools.common.AbstractRuleBase.addRule(AbstractRuleBase.java:618)
 at
org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:500)
 at org.drools.reteoo.ReteooRuleBase.addPackages(ReteooRuleBase.java:379)
 at
org.drools.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseImpl.java:121)

Maybe someone had similar problem and could help me?

I'm using:
* JBoss 4.2.3.GA
* Drools 5.0

Regards,
Piotr
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss by Red Hat @ www.jboss.com