Click here to Skip to main content
15,881,172 members
Articles / Web Development / ASP.NET

Navigational Workflows Unleashed in WWF/ASP.NET 3.5

Rate me:
Please Sign up or sign in to vote.
4.97/5 (42 votes)
21 Oct 2008CPOL18 min read 224.7K   1.6K   165  
Case-study on the internals of a Navigational Workflow engine for a fictional dating website called “World Wide Dating”.
using System;
using System.Workflow.Activities;

namespace DateSiteNavigation
{
    /// <summary>
    /// Class for representing the error event arguments that
    /// get passed into the navigational workflow.
    /// </summary>
    [Serializable]
    public class ErrorEventArgs : ExternalDataEventArgs 
	{
        private ErrorType _errorType;

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="instanceId"></param>
        /// <param name="errorType"></param>
        public ErrorEventArgs(Guid instanceId, ErrorType errorType)
            : base(instanceId)
        {
            _errorType = errorType;
        }

        /// <summary>
        /// Get or set the error type.
        /// </summary>
        public ErrorType ErrorType
        {
            get { return _errorType; }
            set { _errorType = value; }
        }
	}


    /// <summary>
    /// Class representing different error types. This is used in the 
    /// ErrorEventArgs to help determine the error page to go to.
    /// </summary>
    [Serializable]
    public sealed class ErrorType
    {
        private string _errorName;

        // static object references
        public static readonly ErrorType Generic = new ErrorType("generic");
        public static readonly ErrorType Unknown = new ErrorType("unknown");

        /// <summary>
        /// Private constuctor.
        /// </summary>
        /// <param name="errorName"></param>
        private ErrorType(string errorName)
        {
            _errorName = errorName;
        }

        /// <summary>
        /// Get the error name.
        /// </summary>
        /// <returns></returns>
        public string GetErrorName()
        {
            return _errorName;
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Founder Turing Inc.
United States United States

Comments and Discussions