I have a workflow with
start -> script task1 -> workitem1 ->signal -> script task2 -> workitem2 -> end
If state is saved at signal, and at script task2 server crashes, then, upon restarting server, I have to load all processIds that server was running (probably from database) and also load the last signal to be able to correctly start these processes.
StatefulKnowledgeSession ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(sid, kbase, config, env); [This wont start the process from where it left off]
ProcessInstance pi = (ProcessInstance) ksession.getProcessInstance(pid);
pi.signalEvent(signal, signalData); // I have to store these in some store to be able to restart correctly after reload