Windows Workflow Foundation 3


Workflow Persistence & Event Arguments


I'm developing a State Machine workflow that passes parameters through events. The Workflow will have to persist its state in a SQL database. My understanding is that the persistence services will persist the current state of the Workflow (e.g. which state the Workflow is in). The workflow is rather useless without also persisting the parameters passed in the event arguments. Will the Workflow Persistence Services automatically persist the values passed in the event arguments or will I have to manually persist these parameters in the database?Thank you in advance,-- Sean
The parameters that you passed in get assigned to properties.  The persistence service binary serializes the workflow instance.  As long as the workflow doesn't change the values of the properties that the parameters were assigned to their original value will be persisted.
Thanks,
Joel West
MSFTE - SDE WF runtime and hosting
This posting is provided "AS IS" with no warranties, and confers no rights
The parameters that you passed in get assigned to properties.  The persistence service binary serializes the workflow instance.  As long as the workflow doesn't change the values of the properties that the parameters were assigned to their original value will be persisted.
Thanks,
Joel West
MSFTE - SDE WF runtime and hosting
This posting is provided "AS IS" with no warranties, and confers no rights
Thank you very much!
It's not obvious to me how to get the User Events back from the SqlTrackingService.  I can see all the Workflow and Activity events in the SQL database, but I can't see the User Events.  What is the proper way to get these values back?
If you are tracking any data using TrackData method, it will be saved as User Events. Here is a code snippet to access User events
SqlTrackingWorkflowInstance sqlTrackingWorkflowInstance;
            if (sqlTrackingQuery.TryGetWorkflow(workflowInstanceId, out sqlTrackingWorkflowInstance))
            {
                foreach (UserTrackingRecord userTrackingRecord in sqlTrackingWorkflowInstance.UserEvents)
                {
                    Console.WriteLine("\nUser Tracking Event : Event Date Time : {0}, Event Data : {1}\n", userTrackingRecord.EventDateTime.ToString(), userTrackingRecord.UserData.ToString());
Take a look at the sample UserTrackPoints in section \Windows Workflow Foundation\Samples\Technologies\Tracking\UserTrackPoints
Thank you, SonaliC!Using the StateMachine lab #4 as an example, I'm passing the OrderID in the event arguments to the Workflow.  I can see EventArgs in the userTrackingRecord, but it's always null.  Is there where my arguments should be?
Anybody?
Hi Senfo,
                 No. You should be able to get the tracked data in UserTrackingRecord.UserData. Also, make sure that you are looking at the correct user tracking event. If your profile enables all user events, you will also see state change events. To filter out just your events, use any string value for the key and you can add a profile which allows only events with that particular key.
Ranjesh

Related Links

Error in my WorkFlow (Response.Redirect)
Approving Multiple Records in one go..
Dynamic Update
The Executing event of all my SetStateActivity objects dont fire
Design guidance needed for WWF application
Custom pub/sub service for WF message correlation
Is there any event get fired when I changed the content in the workflow designer?
Subscription handler threw System.FormatException
How can I designate string[] field as returnValue for ReceiveActivity?
is the "workflows in memory" performance counter failing to be reset?
Creating a workflow dynamically
writing non-persistance data to Oracle from a workflow app
Is Workflow Foundation a good fit for multiple workflow processes
The workflow failed validation
Can SQL compact edition be used for persistence and tracking storage?
Invoking multiple web service using InvokeWebServiceActivity combined with transaction

Categories

MSDN
BizTalk Server
Windows Forms
Dynamics
Project Server
Silverlight
Project
Archived Forums A-B
Archived Forums N-R
Archived Forums SA-SM
Archived Forums V
Archived Forums Visual...
Archived Forums X-Z
OneDrive Development
Archived Forums
Maps In Windows
Off-Topic Posts (Do No...
Visual C#
Parallel Computing in ...
Windows Desktop Develo...
Windows Desktop Develo...
Microsoft Message Queu...
Windows Desktop Debugging
Windows Filtering Plat...
Windows Desktop SDK
Open XML Format SDK
SharePoint 2013 - Deve...
SharePoint 2010 - Search
SharePoint Legacy Vers...
SharePoint Legacy Vers...
Azure BizTalk Services
Azure Pack
Microsoft Azure Site R...
Azure Backup
Azure Scheduler
Azure Data Factory
Azure Log Analytics
Azure SQL Data Warehouse
Azure Functions
Azure Data Lake Analyt...
Azure Time Series Insi...
Team Foundation Server...
Team Foundation Server...
BizTalk ESB Toolkit
Commerce Server 2007
Commerce Server 2009
Reactive Extensions (Rx)
The Forum of Sho
Internet Explorer Web ...
Microsoft Translator D...
Microsoft Translator H...
Small Basic
SQL Server Reporting S...
SQL Server Analysis Se...
SQL Server Data Access
Getting started with S...
Microsoft Drivers for ...
SQL Server Master Data...
SQL Server Distributed...
Windows Embedded 8 Sta...
Standard 2009: Embedde...
Standard 7: Misc
Windows Embedded Compa...
SQL Server 2012 Integr...
SQL Server 2012 Spatia...
Windows Forms Data Con...
Windows Live Writer: D...
CRM Deployment
MSDN and TechNet Searc...
Office XML, ODF, and B...
Bing Ads API: Development
Exchange Server Develo...
Microsoft Lync Persist...
Microsoft Lync Client ...
Performance Profiling ...
Accessing Web Services...
Expression Studio with...
Expression Design
Connected Services Fra...
Search Server: Install...
Microsoft Security Dev...
.NET Framework Network...
Audio API and Programm...
App Producer (archived)
CAT.NET
Face Tracking – Kinect...
Git, Mercurial and Dro...
Innovate on Office
Installing and Registe...
Office Live Small Busi...
Parallel Computing Gen...
patterns & practices: ...
Popfly Explorer
POS for .NET
Search, Organize, and ...
Small Business Applica...
SQL Server 2014 Data Q...
SQL Server 2014 Self-S...
SQL Server 2014 Databa...
SQL Server 2014 Report...
Team Foundation Server...
Using Visual Round Tri...
Tools for Windows Phon...
Visual Basic 2008 (Pre...
Visual Basic for Appli...
Visual Studio Team Ser...
Visual Studio Applicat...
Visual Studio Editor i...
Visual Studio Team Sys...
Visual Studio Web Perf...
Working with Data in W...
Building Windows Store...
Expression Blend for W...
XML Paper Specificatio...
Kinect for Windows v2 SDK
Kinect for Windows v1 SDK
Windows IoT
Maps In Windows - APIs
Open source Developmen...

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile