Persistenced Workflow Instances
Dear all,
I enabled the SQLPersistenceService and set UnloadonIdle=true.
Now, the workflow will be unloaded automatically when idle. But how I can know how many persistenced workflow instances in the Database after host restart?
Can it be done without using the Tracking service?
Please help.
Thanks.
Andy
[349 byte] By [
AndyHo] at [2007-12-22]
Hello, Andy.
You can use the method GetAllWorkFlows() of the SqlPersistenceService instance. Of course you must use the same connection string when you start the host again.
My experience was that persisted workflows will be automatically reloaded on host restart, when you set UnloadOnIdle = true in the constructor of the SqlPersistenceService.
I am using Beta 2.2.
Iris,
Thanks. Will try to use the GetAllWorkflows function.
My workflow is a statemachine workflow, which require human approval process to trigger the next stage, I set to unload the instance and the manager will use another host to check for outstanding items from the persistence store.
I added an event handler to track the Workflow Load event. But when the host restart, the event hasn't been fire. So I assume the system hasn't try to load the persistenced workflow instanced.
Andy Ho
Hallo, Andy.
Please try with UnloadOnIdle = true in the constructor of the SqlPersistenceService, when starting the second host. This should automatically load persisted workflows when an event is raised (e.g. their timeout interval is exceeded).
Otherwise with UnloadOnIdle = false you must load the workflow manually by it's ID.
You will get all the persisted instances by the method GetAllWorkflows().