[jboss-user] [jBPM] - ClassCastException in DynamicUtils when using JPAKnowledgeService.loadStatefulKnowledgeSession()

Wooi Joe Chuah do-not-reply at jboss.com
Thu Nov 29 22:17:28 EST 2012


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&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20121129/8b2e63c1/attachment-0001.html 


More information about the jboss-user mailing list