Update (PersistenceManager)

bob mcwhirter <[email protected]> Fri, 4 Apr 2003 19:23:26 -0500 (EST)
Newsgroups gmane.comp.java.werkflow
Message-ID <[email protected]>
Due to confusion on IRC and massive changes in CVS, here's a quick
mail outlining how the new Persistence service works.

The persistence service is actually 2 interfaces:

--- PersistenceManager

    This is the main entry-point into a given persistence
    service, for example, a PrevaylerPersistenceManager or a
    HibernatePersistenceManager.

-- ProcessPersistenceManager

   Each process deployed within the engine will/should receive a
   ProcessPersistenceManager responsible for the persistence of a single
   process's cases, correlations, etc.

The basic call sequence is:

1) intialize a WorkflowEngine with a PersistenceManager.  No persistence
   is actually performed at this point, as persistence always occurs
   within the context of a Process.

2) an admin will deployProcess() via the WfmsAdmin interface for each
   process the engine should be able to handle

3) each deployProcess() call will percolate to PersistenceManager.deployProcess() 
   which should return a ProcessPersistenceManager.  This is where the PPM
   should load any previously persisted data, or establish connections to DBs
   to be able to fetch case-data, correlations, etc, for the single deployed
   Process.  

4) an admin may undeployProcess() which will shutdown the PPM via undeploy()
   which is where the PPM should swap any unflushed data to disk and shutdown.
   the PersistenceManager may still be live, as other PPMs may be active
   for other processes.

5) an admin may shutdown() the engine, which will iterate and undeploy() 
   all PPMs.

So...

A WorkflowEngine has exactly 1 PersistenceManager

Each PersistenceManager has exactly 1 ProcessPersistenceManager for each 
deployed process.  The number of deployed processes may vary over time.

A ProcessPersistenceManager is responsible for persisting only the data
(case-data, correlations, uncorrelateds) associated with a single process.

	-bob