JBoss Community

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

created by Maciej Swiderski in jBPM - View the full discussion

Marcelo, maybe you could try something like this instead of all this casts:

 

        StatefulKnowledgeSession ks = ksession.execute(new GenericCommand<StatefulKnowledgeSession>() {

            public StatefulKnowledgeSession execute(Context context) {

                return ((KnowledgeCommandContext) context).getStatefulKnowledgesession();

               

            }

        });

where ksession is CommandBasedStatefulKnowledgeSession and ks will be its undelying InternalKnowledgeRuntime.

 

HTH

Reply to this message by going to Community

Start a new discussion in jBPM at Community