Try casting ksession.getProcessInstance() to org.jbpm.process.instance.ProcessInstance as it should implement it so you will have access to the context instance.
HTH
Reply to this message by going to Community
Start a new discussion in jBPM at Community