[rules-users] Drools reflection problem.

tom ska tiberium.linux at gmail.com
Tue Sep 14 10:34:53 EDT 2010


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100914/c6bcff98/attachment.html 


More information about the rules-users mailing list