Windows Workflow Foundation (WF4) - Workflow Services and Auto-Start

This sample application demonstrates how you can create a Workflow Service that will automatically start and periodically wake up to do some work. The sample also demonstrates a UI that shows the progress of the work and provides control and query capabilities.

C# (249.0 KB)
 
 
 
 
 
4 Star
(6)
4,302 times
Add to favorites
4/28/2011
E-mail Twitter del.icio.us Digg Facebook
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="GetWorkflowInstanceID.cs" company="Microsoft">
//   Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <summary>
//   The get workflow instance id.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace BatchWeb
{
    using System;
    using System.Activities;

    /// <summary>
    /// The get workflow instance id.
    /// </summary>
    public sealed class GetWorkflowInstanceID : CodeActivity
    {
        #region Properties

        /// <summary>
        /// Gets or sets InstanceId.
        /// </summary>
        public OutArgument<Guid> InstanceId { get; set; }

        #endregion

        #region Methods

        /// <summary>
        /// The execute.
        /// </summary>
        /// <param name="context">
        /// The context.
        /// </param>
        protected override void Execute(CodeActivityContext context)
        {
            this.InstanceId.Set(context, context.WorkflowInstanceId);
        }

        #endregion
    }
}