Hi,
in my package definition I have two kinds of facts. I use stateFullSession
and I send to ksession facts of two different types. For each type I have
one rule using only this type. So what I am doing is processing two
different fact's types in one session. I start fireAllRules, and I know it
fires good rules, and all is working fine. But problem appears later - when
I want to get my fact's back using Drools reflection API.
With first type (facts of first type) all is working fine, but when I change
factType object to "point" into another type (the second one), I get
problems:
[ERROR] package.Type2 cannot be cast to package.Type2
java.lang.reflect.InvocationTargetException
It is thrown when I call
kbase.getFactType(package, Type2).get(factObject , "filed1_name");
I know that factObject is good, because when I use syso (factObject) I get
what I want.
What surprises me is when I call it for Type1 it works. Also, if I process
in ksession only one fact type using my code, I don't get this error (for
first and second fact type).
Thanks,
tom.