Passivating a workflow

  • Thread starter Thread starter Urs
  • Start date Start date
U

Urs

Hi

What happens to workflow references to objects outside the workflow class
instance, when passivating a workflow, having SqkWorkflowPersistenceService
enabled?

Example: Let's say my workflow holds a reference to a class instance in the
host. A workflow is waiting for a few days. In the meantime, the machine is
rebooted. I understand that the persistence objects come back to life, and
my particular workflow will continue waiting.

Q1: Where does my original reference ot that class instance point to after
restarting?
Q2: How do I reset that reference that it actually points to the new
instance (since I restarted the app)?

Thanks for any hints.
Urs
 
Urs said:
Hi

What happens to workflow references to objects outside the workflow class
instance, when passivating a workflow, having
SqkWorkflowPersistenceService enabled?

If the object you're referencing is marked with the [Serializable] attribute
then it will be serialized and deserialized along with your activity. If it
isn't, an exception is thrown.

There are many ways to control the serialization process if that won't work
for your application.
Example: Let's say my workflow holds a reference to a class instance in
the host. A workflow is waiting for a few days. In the meantime, the
machine is rebooted. I understand that the persistence objects come back
to life, and my particular workflow will continue waiting.

If your host is providing something that your activities use, you should
probably expose the object by having the host register it as a service (see
WorkflowRuntime.AddService()) Then, the activity should get a reference to
the service when it needs it.
 
Back
Top