JBoss Community

Re: Process persistense - change WHEN it should happen!

created by nt2005 in jBPM - View the full discussion

Hey again,

 

I want to manage persistence by my own. I am sure that I want this... ;)

 

I know how to persistence a StatefulKnowledgeSession and a ProcessInstance with marshaller. BUT after reloading a session and process I would like to go one with the process. But I have no idea how to combine a session und process again.

 

Example:

StatefulKnowledgeSession ksession = getKnowledgeBase().newStatefulKnowledgeSession();
registerWorkItems(ksession);     // add Workitems to the session
 
ProcessInstance process = ksession.startProcess( "de.tud.iwm.catena.analysis.new" );
 
storeSession(ksession);     // using marshaller
storeProcess(process);     // using marshaller
 
// do anything else...
 
// and anywhen, anywhere - reload all
 
StatefulKnowledgeSession ksession = loadSession();
ProcessInstance process = loadProcess();
 
/*

And now I cannot use:
ksession.getWorkItemManager().completeWorkItem(....)     Because the reloaded session does not know anything of the process


ksession.getProcessInstance(...)  does not work - understandable

I was looking for somehting like: 
ksession.addProcess(process)

*/

 

Thanks in advance. If it makes no sense to you what I really want and do, say it please. But it is hard for me to tell you it in english. O.o German would be a bit easier. ;)

Reply to this message by going to Community

Start a new discussion in jBPM at Community