-
1. Iterate over all existing sessions at startup
salaboy21 Feb 10, 2011 7:06 AM (in response to bwallis42)Hi Brian, you will have a row for each processinstance that you have running inside the ProcessInstanceInfo table. Did you check that?
Notice that there is a Status, or Completed field that indicates if the process has ended or not.
Greetings.
-
2. Iterate over all existing sessions at startup
odelyaholiday Feb 10, 2011 7:12 AM (in response to salaboy21)Hi Mauricio
Are ProcessInstanceInfo rows in the table are deleted everytime that the session /server stops?
-
3. Iterate over all existing sessions at startup
salaboy21 Feb 10, 2011 7:18 AM (in response to odelyaholiday)Nope, the Database is used to keep the processes safe. You need to understand that the processes will be stored each time that they reach a wait state (async task, like human tasks). If it's an in memory (all synchronous tasks) process it will not be persisted.
Cheers
-
4. Iterate over all existing sessions at startup
odelyaholiday Feb 10, 2011 7:59 AM (in response to salaboy21)Mauricio Salatino wrote:
If it's an in memory (all synchronous tasks) process
do you mean h2 database?
what could make a process in memory?
-
5. Iterate over all existing sessions at startup
salaboy21 Feb 10, 2011 8:06 AM (in response to odelyaholiday)In memory process are the one that doesn't have a wait state/safe point in them. When that happens (when no async task is included) the process will only run in memory without persisting their state. That's because they can run from the beginning to the end without waiting for an external actor or system to interact with them.
When you use H2 (in memory database), the processes will be persisted as if you were using a common DB.
Greetings.
-
6. Iterate over all existing sessions at startup
odelyaholiday Feb 10, 2011 8:10 AM (in response to salaboy21)You actually mean a process that doesn't have human tasks for instance?
-
7. Iterate over all existing sessions at startup
salaboy21 Feb 10, 2011 8:20 AM (in response to odelyaholiday)Human tasks are async, but you can also have external systems interactions that works asynchronously. You need to think that if your process can start and end only in memory, without waiting any external interaction (Systems or Humans) your process will never be persisted.
-
8. Iterate over all existing sessions at startup
bwallis42 Feb 11, 2011 12:26 AM (in response to salaboy21)Mauricio Salatino wrote:
Hi Brian, you will have a row for each processinstance that you have running inside the ProcessInstanceInfo table. Did you check that?
Notice that there is a Status, or Completed field that indicates if the process has ended or not.
Greetings.
I see that in the code in ProcessInstanceInfo which would let me get the ProcessInstance. But I cannot see any way to find the session from there.
I believe that I need to recreate all the old sessions on restart which is exactly what I need since I can then assert new facts into these sessions which will cause the workflow processes to continue processing (remember, I have a session per process).
I found a mention of this in an old post by Kris (from Aug 22, 2009):
So whenever the application needs to be restarted, you must restore the
session (either creating a new one or reloading it using the unique
session id). Execution will then continue as before. For example, if a
user then completes a task that was requested by a specific process
instance, the engine will automatically know that that user task was
related to that specific process instance and reload its previous state
from the database.
So, as long as you make sure that the session is restarted, all process
instances will continue from the state they were at before without you
having to do anything.
but I am still not sure how I do this or whether or not I need to persist the unique session IDs when I create them in the first place
thanks.
-
9. Re: Iterate over all existing sessions at startup
jlgranda81 Jul 28, 2011 12:48 PM (in response to salaboy21)Mauricio, is possible overwrite JPAProcessInstanceManager or create a subclass for overwrite removeProcessInstance method?