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

State Machine Complier And Asp.net

Rate me:
Please Sign up or sign in to vote.
4.56/5 (4 votes)
20 Oct 2008CPOL4 min read 55.6K   307   31  
This article demonstrate the implementation of State Machine Compiler in .NET. This is small proof of concept for developing state machine workflow activity.
using System;
using System.Collections.Generic;
using System.Text;
using Domain;
using ServicesProvider;

namespace StateMachineWorkflowActivity
{
    public class CarWF:ICarWF
    {
        private Car m_Car = null;
        private IWFStateTransition m_WFStateTransition;
        private IServiceStateChangeAction m_ServiceStateChangeAction;
        #region ICarWF Members

        #endregion

        #region ICarWF Members

        public Car CarEntity
        {
            get  { return m_Car; }
            set  { m_Car = value;}
        }
        public IServiceStateChangeAction ServiceStateChangeAction
        {
            set { m_ServiceStateChangeAction = value; }
        }
        public IWFStateTransition WFStateTransition
        {
            set { m_WFStateTransition = value; }
        }

        #endregion

        #region IWFStateTransition Members

       public  void SubmitRun()
        {
            m_WFStateTransition.SubmitRun();
        }

       public void SubmitSlowDown()
        {
            m_WFStateTransition.SubmitSlowDown();
        }

        public void SubmitStop()
        {
            m_WFStateTransition.SubmitStop();
        }

        #endregion

        #region IServiceStateChangeAction Members

       public void UpdateState(Car car, Utilities.CarState currentState, Utilities.CarState previousState)
        {
            this.m_ServiceStateChangeAction.UpdateState(car,currentState,previousState);
        }

        #endregion

        #region ICarWF Members

        Car ICarWF.CarEntity
        {
            get
            {
                throw new Exception("The method or operation is not implemented.");
            }
            set
            {
                throw new Exception("The method or operation is not implemented.");
            }
        }

        #endregion

   

 


    }
}

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
Technical Lead
Australia Australia
Whatsup-->Exploring--> MVC/HTML5/Javascript & Virtualization.......!
www.santoshpoojari.blogspot.com

Comments and Discussions