Copied to clipboard

Flag this post as spam?

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


  • Braydie 148 posts 346 karma points
    Mar 26, 2012 @ 15:48
    Braydie
    0

    Custom Workflows in Contour 2.0 beta

    I've been going through the new version of Contour for Umbraco 5 and am now looking at implementing some custom workflows and I have some code that should work but I think I'm missing something as it is not available in the workflow type drop down. Once compiled I'm just dropping the .dll in the bin directory.

    Here is my code:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Umbraco.Forms.Core;
    using Umbraco.Forms.Core.Attributes;
    using Umbraco.Forms.Core.Enums;
    using Umbraco.Forms.Data.Storage;
    using Umbraco.Forms.Data;
    
    namespace Site.Extensions
    {
    
        class CustomWorkflow : WorkflowType
        {
    
            public CustomWorkflow()
            {
                this.Id = new Guid("A099EABD-EC80-4497-A9CD-1E1ECA75E467");
                this.Name = "test workflow";
                this.Description = "quick test";
            }
    
            public override WorkflowExecutionStatus Execute(Record record, RecordEventArgs e)
            {
                //do something
    
                return WorkflowExecutionStatus.Completed;
            }
    
            public override List<Exception> ValidateSettings()
            {
                return null;
            }
    
        }
    }
    
    Thanks!

     

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Mar 26, 2012 @ 16:41
    Tim Geyssens
    0

    Hey,

    There is an attribute you must use to decorate your assembly if it contains contour addons

    So in the AssemblyInfo.cs file of you project just add

    [assembly: AssemblyContainsContourProviders]

    Found in the Umbraco.Forms.Core.Attributes namespace

    Let me know if that does the trick

  • Braydie 148 posts 346 karma points
    Mar 26, 2012 @ 17:28
    Braydie
    0

    Hi Tim,

    Thanks for you reply. I've added that to the AssemblyInfo but unfortuntately that hasn't worked, is there anything else I need to do?

    Thanks,

    Braydie

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Mar 26, 2012 @ 17:52
    Tim Geyssens
    0

    Incrementing your assembly version might help to avoid it being cached

  • Braydie 148 posts 346 karma points
    Mar 27, 2012 @ 10:00
    Braydie
    0

    Hi Tim,

    I've tried this, but again no joy..

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Mar 27, 2012 @ 10:13
    Tim Geyssens
    0

    Hmm try clearing temp asp.net files, I'll also take a look with a test solution but all the providers are also in a extra assembly so should work...

  • Braydie 148 posts 346 karma points
    Mar 27, 2012 @ 10:49
    Braydie
    0

    I've cleared my temporary asp.net files but it's made no difference.. I've also tried doing doing my workflow in another solution but that has not worked either..

  • Braydie 148 posts 346 karma points
    Mar 27, 2012 @ 13:32
    Braydie
    0

    Hi Tim, I thought I'd try and do another solution again and this time it has worked. Not sure what is different this time, but it seems to be working ok now...! Thanks for your help

  • 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