Thursday, 27 September 2012

How to use Delay Activity in Workflow 4.0


Delay Activity

This activity allows you to build interval-based pauses into a workflow. You may call it as a timer activity that will set duration so that the workflow will pause before continuing to execute.
Namespace System.Activities

Steps:
1). Start VS2010
2). Go to File Menu Select New Project then select Workflow Console Application.
3). In this project workflow1.xaml file will be seen.
4). From the toolbox, Drag the Sequence Activity from the Control Flow tab.
5). After that Drag the Delay Activity from the Primitive tab in the Sequence.
6). Right click on delay activity and click on properties. Here we can see the expression editor property.
Set i.e. TimeSpan.fromSeconds(5)





7). Press F5
Output: (Note: if you cannot see the result then please write Console.ReadLine () in Program.cs after invoking.


No comments:

Post a Comment