use JPAKnowledgeService.loadStatefulKnowledgeSession to load ksession from data base.
Yes, JPAKnowledgeService.loadStatefulKnowledgeSession method is to load ksession.
In order to load ksession, I need to know the session id. Session id is stored in sessioninfo table in database.
But, I want to get session id from database.
If you have any suggestion, kindly let me know.
Wai Lwin Moe
From where you are trying to load knowledgeSession?
do you have taskid or workitemid?
It depends on you requirement. provide code and scenario. If you have taskid then use code like this.
Long workItemId = loadedClient.getTask(taskId).getTaskData().getWorkItemId();
int sessionId = loadedClient.getTask(taskId).getTaskData().getProcessSessionId();
I do not have taskid or workitemid.
I want to get sessionid in project intialization. I have only kBase which loads jbpm files and entityManager.
If you have any idea, kindly tell me.
Wai Lwin Moe.
In that case, you can execute query to load all sessions
Select * from sessioninfo;
you can use kBase.getStatefulKnowledgeSessions() method to load all session in knowledgebase.