Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • James Senior 4 posts 24 karma points
    Aug 20, 2010 @ 16:06
    James Senior
    0

    Custom WorkflowType not showing in new workflow drop down

    Hi All - 

    I've created a very simple WorkflowType to redirect the user to another page.  However when I load the class file into app_code and head back to contour to create a workflow, I don't see the new workflowtype in the drop down list.  From the docs it seems easy, and it says no other configuration is required.  I am missing something?  The custom workflow type is below.

    Thanks for your help!

    James

    using System;

    using System.Collections.Generic;

    using System.Text;

    using System.Web;

     

    using Umbraco.Forms.Core;

    using Umbraco.Forms.Core.Enums;

    using Umbraco.Forms.Data.Storage;

     

    public class Redirect : Umbraco.Forms.Core.WorkflowType

        {

            [Umbraco.Forms.Core.Attributes.Setting("Redirect Url", description = "Enter the Url to redirect to", control = "Contour.SharedSource.FieldSetting.TextField")]

            public string RedirectUrl { get; set; }    

     

     

            public Redirect()

            {

                this.Id = new Guid("1996a911-bb99-4b9a-8356-ec9f8a9369e8");

                this.Name = "Url Redirect";

                this.Description = "Redirects to a Url of your choice";

            }

     

            public override List<Exception> ValidateSettings()

            {

                List<Exception> l = new List<Exception>();

                if (string.IsNullOrEmpty(Url))

                    l.Add(new Exception("'Url' setting not filled out'"));

     

                return l;

            }

     

            public override WorkflowExecutionStatus Execute(Record record, RecordEventArgs e)

            {

                HttpContext.Current.Response.Redirect(this.RedirectUrl);

                return WorkflowExecutionStatus.Completed;

            }

        }

     

  • James Senior 4 posts 24 karma points
    Aug 20, 2010 @ 16:42
    James Senior
    0

    I just realized I mis-typed the RedirectUrl in this line of code:

    if (string.IsNullOrEmpty(Url))

    It should be

    if (string.IsNullOrEmpty(RedirectUrl))

  • Comment author was deleted

    Aug 23, 2010 @ 09:02

    Hi James,

    It seems that putting the class file in app_code in certain cases the reflector can't find the class, currenlty a workaround would be to compile to dll instead.

    Regards,
    Tim

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies