[jboss-user] [jBPM] - Re: WorkflowProcessInstanceUpgrader throwing ClassCastException: ...CommandBasedStatefulKnowledgeSession cannot be cast to ...InternalKnowledgeRuntime

Marcelo Zabalet do-not-reply at jboss.com
Fri Jan 11 08:45:02 EST 2013


Marcelo Zabalet [https://community.jboss.org/people/zabalet] created the discussion

"Re: WorkflowProcessInstanceUpgrader throwing ClassCastException: ...CommandBasedStatefulKnowledgeSession cannot be cast to ...InternalKnowledgeRuntime"

To view the discussion, visit: https://community.jboss.org/message/790420#790420

--------------------------------------------------------------
Ok, have sense... CommandBasedStatefulKnowledgeSession is more like a wrapper. So, this works, although I´m not sure about so much casting...

CommandBasedStatefulKnowledgeSession commandBasedKSession = (CommandBasedStatefulKnowledgeSession) knowledgeSession;
CommandService commandService = commandBasedKSession.getCommandService();
SingleSessionCommandService singleSessionCommandService = (SingleSessionCommandService) commandService;
StatefulKnowledgeSession statefulKnowledgeSession = singleSessionCommandService.getStatefulKnowledgeSession();
WorkflowProcessInstanceUpgrader.upgradeProcessInstance(statefulKnowledgeSession , processInstance.getId(), targetProcessDefinitionId, mapping);
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/790420#790420]

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/20130111/cc849519/attachment.html 


More information about the jboss-user mailing list