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)
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.
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;
}
}
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
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
is working on a reply...