JBoss Community

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

created by Marcelo Zabalet in jBPM - View the full discussion

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

Start a new discussion in jBPM at Community