Wait For Input Activity
This sample demonstrates how to create named bookmarks in a workflow. Windows Workflow Foundation (WF) does not provide an activity for declarative bookmark creation. Therefore, when you want to create a bookmark in your workflow, you must write a custom activity that creates it. The
WaitForInput activity defined in this sample provides this functionality, so that users can create bookmarks declaratively within a workflow.
|Project Name||Description||Main Files|
Custom designer for the
WPF type converter used to update the generic type of the activity in the designer.
|WaitForInputTestClient||Sample client application that configures and runs a workflow using several WaitForInput activities using the workflow designer.||Sequence1.xaml|
A sequential workflow that uses the
Runs an instance of the workflow defined in Sequence1.xaml.
WaitForInput activity creates a named bookmark in a workflow. The bookmark waits for a signal and receives data of its configured type. After the bookmark is resumed the data passed into the workflow is available through the
The activity has three attributes applied to it for binding a designer, adding the generic argument feature that can be updated, and setting the default generic type to string. The activity also has the arguments listed in the following table.
|TResult||Generic argument (TResult)||Type of the bookmark. This is the type of the data to be passed to the bookmark when resumed.|
|BookmarkName||InArgument<string>||Name of the bookmark.|
|Result||InArgument<TResult>||Data passed to the activity when the bookmark is resumed.|
WaitForInput activity designer is implemented in the WaitForInputDesigner.xaml file. The
WaitForInput activity and its designer are included in the same assembly. The following graphic shows the
WaitForInput activity in the toolbox within a category that has the same name as the assembly.
The following graphic shows the
WaitForInput designer. Because, the
WaitForInput activity is very basic, the designer allows setting all its arguments directly in the designer surface.
Using Visual Studio 2010, open the WaitForInput.sln file.
To build the solution, press CTRL+SHIFT+B.
To start the sample without debugging, press CTRL+F5.
The samples may already be installed on your machine. Check for the following (default) directory before continuing.
If this directory does not exist, go to Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF) Samples for .NET Framework 4 to download all Windows Communication Foundation (WCF) and WF samples. This sample is located in the following directory.