Create webflow model

Open your ASP.NET MVC project and in Models folder create new class file PersonData.cs. In this file create your model which will store your flow data.

public class PersonModel
    public string FirstName { get; set; }
    public string LastName { get; set; }

Next you should create another file that will have definition of your flow.

using Rosieks.Web.Flow;
using Rosieks.Web.Flow.Fluent;
using Rosieks.Web.Flow.Metadata;

public class PersonFlow : WebflowModel<PersonModel>
    public PersonFlow() : base("Person")
        this.RegisterStates(s => s

            // First step that contains two textbox to provide FirstName and LastName
                .WithTransitions(t => t.Transition("next", "Step2"))
                .WithRoute("PersonWizard", new { step = 1}, "create-person/{step}")

            // Second step that display FirstName and LastName and ask user to confirm data.
                .WithTransitions(t => t
                    .Transition("back", "Step1").WithoutValidation()
                    .Transition("next", "Step3"))
                .WithRoute("PersonWizard", new { step = 2})

            // Third/last step - thank you
                .WithRoute("PersonWizard", new { step = 3})

        // Register this webflow in default webflow catalog.

Last edited Nov 3, 2011 at 9:32 PM by rosieks, version 3


No comments yet.