HI.
I am getting following exception.
Exception in thread "main" org.drools.RuntimeDroolsException:
d1.rule.Rule_8f09c0aa350100000080cb1e0dd40f6fEval4Invoker@f6f66af4 :*
java.lang.ClassCastException: d1.rule.facts.Medication cannot be cast to
d1.rule.facts.Procedure*
at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:119)
at
org.drools.reteoo.EvalConditionNode.assertLeftTuple(EvalConditionNode.java:178)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:197)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:72)
at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:161)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:458)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:386)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:134)
at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:215)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:244)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:330)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:291)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:886)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:845)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:255)
at d1.rule.facts.PatientFacts.loadFactsInSession(PatientFacts.java:6075)
at d1.rule.DREvaluator.startEvaluation(DREvaluator.java:278)
at d1.rule.DREvaluator.main(DREvaluator.java:72)
Caused by: java.lang.ClassCastException: d1.rule.facts.Medication cannot be
cast to d1.rule.facts.Procedure
at
d1.rule.Rule_8f09c0aa350100000080cb1e0dd40f6fEval4Invoker.evaluate(Unknown
Source)
at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:114)
Following is the rule. I found that due to "or" the Procedure block not
runs.
If I change "or" to "and" than procedure block executed & the
error not
produced.
I am not sure what's the problem, I am using Drool 5.3
rule "8f09c0aa350100000080cb1e0dd40f6f"
when #conditions
(
$cepFacts: CEPFacts(id=="D1")
and
eval($cepFacts.initialize())
and
(
(
$DxDate_1 : ( Medication( name equalsIgnoreCase "Ofloxacin" ) )
and
eval($cepFacts.checkRelativeValues($DxDate_1) )
)
or
(
$DxDate_2 : ( Procedure( name equalsIgnoreCase "Pres antibiotic" )
)
and
eval($cepFacts.checkRelativeValues($DxDate_2) )
)
)
and
(
$DxDate_3 : ( Medication( name equalsIgnoreCase "Trazodone" ) )
and
eval($cepFacts.checkTimeIs($DxDate_3)
)
)
then
resultIds.add("8f09c0aa350100000080cb1e0dd40f6f");
end
--
View this message in context:
http://drools.46999.n3.nabble.com/Getting-java-lang-ClassCastException-us...
Sent from the Drools: User forum mailing list archive at
Nabble.com.