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&...]