You may save it in a variable before disposing the session, for example after creating the session:
ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, environment);
int sessionId = ksession.getId();
Reply to this message by going to Community
Start a new discussion in jBPM at Community