Click here to Skip to main content
15,881,455 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>
    /// Defines the contract for the navigational workflow.
    /// </summary>
    [ExternalDataExchange]
	public interface INavigationService
	{
        /// <summary>
        /// Navigate to the previous step.
        /// </summary>
        event EventHandler<ExternalDataEventArgs> Previous;

        /// <summary>
        /// Navigate to the next step.
        /// </summary>
        event EventHandler<ExternalDataEventArgs> Next;

        /// <summary>
        /// Rehydrate a given workflow.
        /// </summary>
        event EventHandler<ExternalDataEventArgs> Rehydrated;        

        /// <summary>
        /// Sent to the navigational workflow to ask it if it is in sync.
        /// </summary>
        event EventHandler<IncomingSynchronizeEventArgs> IncomingSynchronize;

        /// <summary>
        /// Raise a specific error.
        /// </summary>
        event EventHandler<ErrorEventArgs> Error;        

        /// <summary>
        /// Skip to the basics state.
        /// </summary>
        event EventHandler<ExternalDataEventArgs> SkipToBasics;

        /// <summary>
        /// Skip to the appearance state.
        /// </summary>
        event EventHandler<ExternalDataEventArgs> SkipToAppearance;

        /// <summary>
        /// Skip to the lifestyle state.
        /// </summary>
        event EventHandler<ExternalDataEventArgs> SkipToLifestyle;
        
        /// <summary>
        /// Skip to the interests state.
        /// </summary>
        event EventHandler<ExternalDataEventArgs> SkipToInterests;

        /// <summary>
        /// Skip to the complete state.
        /// </summary>
        event EventHandler<ExternalDataEventArgs> SkipToComplete;
        
        /// <summary>
        /// Send a message to the host application of which page to go to.
        /// </summary>
        /// <param name="args"></param>
        void OnPageToGoTo(PageToGoToEventArgs args);

        /// <summary>
        /// Sends a message to host application indicating whether or not the 
        /// workflow is in sync and if not, what needs to be done to synchronize it.
        /// </summary>
        /// <param name="args"></param>
        void OnOutgoingSynchronize(OutgoingSynchronizeEventArgs args);        
	}
}

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