SimonGoldstone
SimonGoldstone

Reputation: 5216

Windows Workflow 3 State Machines - Persisting object along with WF state?

I'm maintaining an app that was built on a WWF3 state machine. Yeh I know, lucky me. What we're trying to do is to be able to persist the WF and re-load it on another machine. The bit I'm struggling to get my head around is how to persist the object on which the WF acts, along with the WF.

We're using the standard SQL Server persistence service. We've got a public property in the Workflow class called "Customer" which gets populated when we start the workflow (by passing in a parameter).

My questions are:

  1. Does the public property Customer get persisted along with the WF state?
  2. If so, how can I get a reference back to the Customer object when the WF is reloaded?
  3. If not, do I just persist my domain object separately and then reload and reassociate it with the WF when the WF itself gets reloaded?

Thanks.

Upvotes: 0

Views: 161

Answers (1)

Jayantha Lal Sirisena
Jayantha Lal Sirisena

Reputation: 21366

I think the better way is to persist only the customer Id , and then load it whenever you need because the customer details(which is may be in the other database) can be changed while the WF instance is persisted.

Upvotes: 0

Related Questions