The restore operation must be performed before the task is completed but not necesarelly by the same thread or application. In order to restore a session you need a kbase containing the definition of the process.
Let's asume you have 1 kbase per application, what you could do is: when the application is started, you restore all the ksessions you have (this information is not easy to retrieve from jbpm's predefined DB and I usually store it myself) using the kbase.
Best Regards,