Windows Workflow Foundation 3


WF custom persistence once again


I don't want to save my workflows zipped in a blob field in one table like default SqlWorkflowPersistenceService does. It is not transparent and flexible approach, saved data contains class type information, making workflow evolution almost impossible.
I would be a happy WF programmer, If someone explains me how to load/save workflow instances in different tables depending on the workflow class name, layout workflow properties in different fields, so I'd be able to make SQL-queries, and globally update my workflow definition using just new a new WF assembly and sql change script...
Or somehow simulate this behavior using persistence & tracking service... 
Alexey - Activity serialization isn't really possible without the ActivitySurrogateSelector added.
Alexey,
Unfortunately schematized instance state (which is what we call what you're trying to do) is not supported in V1.  The recommended approach for saving piece of instance state in a queryable format is to use the WF tracking functionality.
Thanks,
Joel West
MS SDE in WF runtime and hosting
This posting is provided "AS IS" with no warranties, and confers no rights
Alexey -how you store the persisted data isn't going to matter very much if you use the Activity.Load method - since that will end up using binary serialization.
It is much more important what type your process is going to load when you deserialized.  So changing a workflow type would have more to do with changing the underlying type in the CLR type system.  Be forwarned though that doing so can have bad consequences if you were to add a type that could be loaded, or otherwise change the type so that the formatter could deserialized it.
I just noticed, that I may pass my own IFormatter object in Activity.Load...
The question is what internal workflow information do I need to save to load this workflow correctly later?
Alexey - Activity serialization isn't really possible without the ActivitySurrogateSelector added.
What kind of data is actually saved in this blob?
I'm thinking about this. Maybe this is possible.
When runtime asks my persistence service to load a workflow:
1) Using stored procedure I check several tables for this GUID to determine what class of the workflow it is.
2) I create a fresh instance of this workflow class using new() operator.
3) I need somehow to save/restore private members of the workflow. I can define some IWorkflowPersist interface with Load/Save methods, and all my workflows will implement it to load/save private members.
4) I do something like workflow.CurrentState = persisted state, workflow.Timers = persisted timers.
5) return workflow as a result.
I need only help with task #4...
Alexey,
Unfortunately schematized instance state (which is what we call what you're trying to do) is not supported in V1.  The recommended approach for saving piece of instance state in a queryable format is to use the WF tracking functionality.
Thanks,
Joel West
MS SDE in WF runtime and hosting
This posting is provided "AS IS" with no warranties, and confers no rights

Related Links

Bind workflow property to a read-only activity property
Developing an application for a service support provider.
WorkflowRuntime.CreateWorkflow Performance
Access sequential workflow dependency property from custom activity
Access to workflow queues from external processes
Persiste in a custom activity
Workflow re-activates on Final State when using OnWorkflowItemChanged Event
Windows WorkFlow Foundation: Cannot add a new state in between two existing states.
Within VS2008, can't drill down into a workflow without checking it out
SQLTrackingService tracks incorrect WorkflowInstanceEvent order?
XAML Workflows, Property Bindings and Conditions sample
Tracking query timeouts
Insert activity during PreFilterProperties
Passing data from Activity to Activity in XAML Workflows
Problem with x:Class and CreateWorkflow
Activity property resets back to default inside while activity

Categories

MSDN
Visual Studio Languages
Visual FoxPro
BizTalk Server
Dynamics
Archived Forums SA-SM
Archived Forums Visual...
OneDrive Development
Archived Forums
Internet of Things
Software Entwicklung f...
Forums Redesign - Q&A ...
Visual F#
Visual Studio Editor
Application Insights (AI)
General Windows Deskto...
Application Security f...
Windows Imaging Compon...
Windows Desktop SDK
Development with the W...
Excel for Developers
SharePoint 2013 - Setu...
SharePoint Legacy Vers...
Azure Management Portal
Azure Networking (DNS,...
Azure Pack
Azure Cache
Azure Batch
Azure Log Analytics
Language Understanding...
ADO.NET Entity Framewo...
XML, System.Xml, MSXML...
Microsoft Live Labs Volta
Microsoft Translator D...
Small Basic
Microsoft Robotics - C...
SQL Service Broker
SQL Server Database En...
Getting started with S...
SQL Server Spatial
SQL Server Samples and...
Microsoft StreamInsight
Windows Embedded Compa...
SQL Server 2012 Integr...
Windows Server 2008 Ap...
Live Connect (Archived)
Windows Live General: ...
Windows Live Messenger...
Windows Live Messenger...
Windows Live  Spaces: ...
MSDN Subscriptions Fee...
WebsitePanel - Discuss...
Bing Maps for Windows ...
SharePoint Server Prot...
Exchange Server Develo...
Microsoft Unified Comm...
Designing with Silverl...
Expression Encoder
Expression Studio
Windows Performance To...
Retired SharePoint Bus...
.NET Framework 4 setup...
Acropolis
AppFabric Service and ...
Azure Troubleshooting,...
Casablanca
Charts & Reports in th...
Commerce Server 2002 a...
Core Coding Experience...
Dryad, DSC, and DryadL...
Dynamic Languages on .NET
Game Technologies: Aud...
General Troubleshootin...
HD DVD Interactivity A...
Git, Mercurial and Dro...
LINQ to SQL (Pre-Release)
LightSwitch HTML Clien...
Popfly Game Creator
Project Codename:  Jasper
Parallel Programming w...
Search Server: Develop...
Search Server: Report ...
Search, Organize, and ...
Silverlight (formerly ...
Silverlight (formerly ...
Service Bus EAI & EDI ...
Share your How to samp...
SQL Server 2014 Report...
Team Foundation Server...
Team Foundation Server...
Tellme Studio (retired)
Tools for Windows Stor...
Visual C# Express Edition
Visual Studio Performa...
Visual Studio Team Sys...
Visual Studio Team Sys...
Windows Desktop Vista ...
Windows Developer Prev...
Windows Error Reportin...
Windows Live Data Deve...
Windows MultiPoint Mou...
SQL Server 2016 Preview
Azure N-Series Virtual...
Maps In Windows - APIs
Microsoft R Server
Microsoft Graph
Open source Developmen...

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile