Windows Server AppFabric / Workflow Services Demo - Contoso HR

This sample demonstrates how you can use a Windows Workflow Foundation (WF4) Workflow Service and Windows Server AppFabric to construct a long running business process.

C# (6.3 MB)
 
 
 
 
 
4.9 Star
(8)
6,146 times
Add to favorites
12/3/2011
E-mail Twitter del.icio.us Digg Facebook

Solution explorer

C#
namespace UserActivityLibrary
{
    using System.Activities;

    public sealed class ReadLine : NativeActivity<string>
    {
        [RequiredArgument]
        public InArgument<string> BookmarkName { get; set; }

        protected override bool CanInduceIdle
        {
            get { return true; }
        }

        protected override void Execute(NativeActivityContext context)
        {
            // Inform the host that this activity needs data and wait for the callback
            context.CreateBookmark(this.BookmarkName.Get(context), this.OnReadComplete);
        }

        private void OnReadComplete(NativeActivityContext context, Bookmark bookmark, object state)
        {
            // Store the value returned by the host
            context.SetValue(this.Result, state as string);
        }
    }
}