Windows Workflow Foundation 3


When using WWF Beta 2.2, how can you update the parameters collection in a running XOML only State workflow?


Tom,
When using WWF Beta 2.2, how can you update the parameters collection in a running XOML only State workflow?
Thanks in advance,
John Portnov
I'm not Tom - but I'll answer anyway ;-)
There isnt a parameters collection in 2.2.
You have to create a class that derives from StateMachineWorkflowActivity - and that adds public properties (you can add one called Parameters if you'd like).
public sealed partial class MySMWF: StateMachineWorkflowActivity
{
public static DependencyProperty ParametersProperty = System.Workflow.ComponentModel.DependencyProperty.Register("Parameters", typeof(Dictionary<string,object>), typeof(MySMWF));
[Description("This is the description which appears in the Property Browser")]
[Category("This is the category which will be displayed in the Property Browser")]
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public Dictionary<string,object> Parameters
{
get
{
return ((Dictionary<string,object>)(base.GetValue(MySMWF.ParametersProperty)));
}
set
{
base.SetValue(MySMWF.ParametersProperty, value);
}
}
}
Then use this type in your xoml file
John  - if you mean you need to update those parameters *after* you've called CreateWorkflow - then you need to use the standard communication mechanism between the host and a Workflow - the ExternalDataExchangService.
Your workflow would have to be listening for an event, and the Local service in your host would have to fire the event.  You can find samples in Samples\Technologies\Communications in the SDK samples directory.
I'm not Tom - but I'll answer anyway ;-)
There isnt a parameters collection in 2.2.
You have to create a class that derives from StateMachineWorkflowActivity - and that adds public properties (you can add one called Parameters if you'd like).
public sealed partial class MySMWF: StateMachineWorkflowActivity
{
public static DependencyProperty ParametersProperty = System.Workflow.ComponentModel.DependencyProperty.Register("Parameters", typeof(Dictionary<string,object>), typeof(MySMWF));
[Description("This is the description which appears in the Property Browser")]
[Category("This is the category which will be displayed in the Property Browser")]
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public Dictionary<string,object> Parameters
{
get
{
return ((Dictionary<string,object>)(base.GetValue(MySMWF.ParametersProperty)));
}
set
{
base.SetValue(MySMWF.ParametersProperty, value);
}
}
}
Then use this type in your xoml file
This does not specifically answer my question.  I use a Dictionary object to add parameters collection to the CreateWorkflow, in addition to xoml and rules files.  I need to update the running instance of the workflow (need to update its parameters collection).  How do I do it?
 
Sincerely,
John Portnov
John  - if you mean you need to update those parameters *after* you've called CreateWorkflow - then you need to use the standard communication mechanism between the host and a Workflow - the ExternalDataExchangService.
Your workflow would have to be listening for an event, and the Local service in your host would have to fire the event.  You can find samples in Samples\Technologies\Communications in the SDK samples directory.

Related Links

MOSS Publishing Site
WF custom persistence once again
Hands on Labs 2.2
WF Virgin
Error in the Hands on lab 09
Workflow Designer
How do you load XOML only State Workflow in WFPad for WWFBeta 2.2 (with namespace for codebehind assembly, and activities)?
invoke sub StateMachine workflow
Using WWF to model and support "Tech Trees" in RTS games
RuleConditionDialog and intellisense
Workflow Persistence & Event Arguments
PersistenceService - Transaction Timeout
SimpleExpenseReport
SQLTrackingQuery from Workflow
CreateWorkflow failing validation
xbox live mic help

Categories

MSDN
Windows Phone Dev Center
JScript and Scripting
Bing Ads API: Development
Exchange Server
Expression
Project
Archived Forums E-H
Archived Forums W
Kinect for Windows SDKs
MSBuild
Windows Desktop Develo...
Network Monitor
Windows Imaging Compon...
Windows Hardware Testi...
General Office Develop...
Office 365 for Developers
SharePoint 2013 - Gene...
SharePoint 2010 - Deve...
SharePoint Legacy Vers...
Azure Storage
Azure SQL Database
Azure Active Directory
Azure Marketplace
Machine Learning
Azure Service Fabric
Azure Data Catalog
Azure Log Integration
Windows Communication ...
Team Foundation Server...
Team Foundation Server...
Architecture General
Software Modeling Tools
The Forum of Sho
TPL Dataflow
Scripting
SyncFx - SyncToy-File ...
Visual Studio Smart De...
SQL Server Integration...
.NET Framework inside ...
SQL Server Data Access
SQL Server Replication
SQL Server In-Memory T...
Standard 2009: Embedde...
Windows Embedded Compa...
SQL Server 2012 Analys...
Windows Live Messenger...
WebsitePanel - Discuss...
MSDN Magazine
Microsoft Automatic Gr...
Bing Maps for Windows ...
Office XML, ODF, and B...
Exchange Server Develo...
Getting Started with S...
Hosting and Streaming ...
Expression Encoder
Surface Application De...
Retired SharePoint Bus...
Retired SharePoint Acc...
Project Online General...
Announcements about pr...
AppFabric Service and ...
Dryad, DSC, and DryadL...
Dynamic Languages on .NET
General Windows MultiP...
HD DVD Interactivity A...
LINQ Project General
Managed Extensibility ...
Microsoft Security Dev...
Moderator Posting Only...
Monitor, Alert and Aut...
Parallel Computing Gen...
Popfly General Discussion
Oracle on Azure
Silverlight (formerly ...
Using Visual Round Tri...
TFS Deployment to Azure
UI Design for Windows ...
Visual Basic Express E...
Visual Basic IDE
Visual Basic Interop a...
Visual C++ Express Edi...
Visual Studio Database...
Visual Studio Source C...
Visual Studio UI Autom...
Web Sandbox - Exploits
Windows Developer Prev...
Windows MultiPoint Mou...
XNA Framework
Windows Phone Preview ...
.NET Native Preview
Azure N-Series Virtual...
Microsoft Partner Cent...
Skype Web SDK

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile