Using a persistence participant to persist additional data
When the workflow instance is persisted, some additional data may need to be persisted along with the workflow instance. For example, in web applications, different HTTP requests are initialized by different people. So, to make sure our workflow instance is aware of its owner, we should store the user information along with the workflow instance.
Getting ready
We need to make sure we have finished the task of Loading a persisted workflow from the database, which we have seen earlier in this chapter.
How to do it...
Create a workflow project:
Create a new Workflow Console Application under solution
Chapter06
and name the project asUsingPersistenceParticipant
.Create a custom persistence participant:
Add project references to
System.Activities.DurableInstancing
andSystem.Runtime.DurableInstancing
. Add a new code file to project and name the fileMyPersistenceParticipant.cs
. Fill the file with the following code:usingSystem.Activities...