Wooi Joe Chuah [
https://community.jboss.org/people/joe.chuah] created the discussion
"ClassCastException in DynamicUtils when using
JPAKnowledgeService.loadStatefulKnowledgeSession()"
To view the discussion, visit:
https://community.jboss.org/message/779244#779244
--------------------------------------------------------------
Hi,
I've encountered the problem as stated above when using DynamicUtils to
addDynamicSubProcess at the following line
ProcessEventSupport eventSupport =
((InternalProcessRuntime)((InternalKnowledgeRuntime)ksession).getProcessRuntime()).getProcessEventSupport();
The reason as far as I know is because the ksession returned from
JPAKnowledgeService.loadStatefulKnowledgeSession() or newStatefulKnowledgeSession()
which is implemented using org.drools.persistence.jpa.KnowledgeStoreServiceImpl
returns the ksession as a CommandBasedStatefulKnowledgeSession object instance.
The CommandBasedStatefulKnowledgeSession does not implement InternalKnowledgeRuntime and
hence we hit a class cast exception.
The same problem does not occur when using a ksession from the
KnowledgeBuilder>KnowledgeBase>ksession.
Any idea if CommandBasedStatefulKnowledgeSession is going to implement
InternalKnowledgeRuntime in the future or
there's gonna be a fix for using sessions which are loaded from DB? or is it a
limitation
Thanks.
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/779244#779244]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]