Copied to clipboard

Flag this post as spam?

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


  • Alessandro Bellisai 30 posts 120 karma points
    Jul 21, 2020 @ 22:26
    Alessandro Bellisai
    0

    Intercept node id on request publish

    Hi

    How can i detect what is the node on request publish?

    I try to detect the node id on PublishWorkflowProcess.Created event but i can't access to WorkflowInstancePoco object.

    Can someone help me?

  • Nathan Woulfe 447 posts 1664 karma points MVP 5x hq c-trib
    Jul 21, 2020 @ 22:50
    Nathan Woulfe
    0

    Hi Alessandro

    Which Plumber + Umbraco versions? Most recent version for Umbraco 8 has the nodeId as a field on the WorkflowTaskPoco. I can make the same change on the v7 version too.

    N

  • Alessandro Bellisai 30 posts 120 karma points
    Jul 22, 2020 @ 07:20
    Alessandro Bellisai
    0

    Hi Nathan

    I use Plumber 1.3.7 on Umbraco 8.6.1

    My goal is to change a property of a node when i intercept the publish request event.

    Following the code of my custom component used for handle Pulumber Events:

        public class PumberComponent : IComponent
    {
        private readonly ILogger _logger;
    
        public PumberComponent(ILogger loggert)
        {
            _logger = logger;
        }
    
        public void Initialize()
        {
            PublishWorkflowProcess.Created += PublishWorkflowProcess_Created;
            PublishWorkflowProcess.Completed += PublishWorkflowProcess_Completed;
        }
    
        private void PublishWorkflowProcess_Completed(object sender, Plumber.Core.Events.Args.InstanceEventArgs e)
        {
            //The instance of WorkflowInstancePoco present in InstanceEventArgs is private so i can't access here
    
            ....
        }
    
        private void PublishWorkflowProcess_Created(object sender, Plumber.Core.Events.Args.InstanceEventArgs e)
        {
        }
    
    
        public void Terminate()
        {
            ....
        }
    }
    

    The instance of WorkflowInstancePoco present in InstanceEventArgs is private so i can't access inside my event handler.

    Maybe i do it on the wrong way...

    Thanks in advance

    Alessandro

  • Nathan Woulfe 447 posts 1664 karma points MVP 5x hq c-trib
    Jul 22, 2020 @ 07:50
    Nathan Woulfe
    1

    Ah that's a bit useless isn't it... Private event args...

    I'll fix that 🙂

  • Alessandro Bellisai 30 posts 120 karma points
    Jul 22, 2020 @ 08:10
    Alessandro Bellisai
    0

    Great!

    Thanks a lot

    HFYR!

  • Nathan Woulfe 447 posts 1664 karma points MVP 5x hq c-trib
    Jul 22, 2020 @ 10:15
    Nathan Woulfe
    0

    My bad! All the others were correct, but not those raised in the WorkflowProcess events... Build is running now, will be on NuGet in 15 or so minutes. Plumber.Workflow.1.3.8-beta-000408 is the one you need, if you could update and let me know if the issue is resolved.

    Nightly will also have some other unfinished bits in it because I was too quick on the commit-button click, and didn't exclude other work.

    Changes add a caching layer for settings, which probably won't be noticeable but will lessen the load on the db. Not fully tested, so let me know if anything is dead/broken/missing.

  • Alessandro Bellisai 30 posts 120 karma points
    Jul 22, 2020 @ 13:37
    Alessandro Bellisai
    0

    Sorry Nathan

    On visual studio, itellisense, i can access to Instance, but at runtime i get this error:

    Attempt by method 'qwerty.unipd.ucw.code.component.PumberComponent.PublishWorkflowProcess_Created(System.Object, Plumber.Core.Events.Args.InstanceEventArgs)' to access method 'Plumber.Core.Events.Args.InstanceEventArgs.get_Instance()' failed.
    
  • Alessandro Bellisai 30 posts 120 karma points
    Jul 22, 2020 @ 13:08
    Alessandro Bellisai
    0

    Hi Nathan

    Plumber.Workflow.1.3.8-beta-000408 Rocks!

    Thanks

  • Nathan Woulfe 447 posts 1664 karma points MVP 5x hq c-trib
    Jul 22, 2020 @ 21:50
    Nathan Woulfe
    0

    I can't reproduce that issue... Running 408 build on Umbraco 8.6.3 in release or debug mode, works fine (I'm testing by logging the node id on create/cancel)

    Have you tried any of the other events? Try GroupService.Updated, then make changes to an approval group.

  • Alessandro Bellisai 30 posts 120 karma points
    Jul 23, 2020 @ 07:45
    Alessandro Bellisai
    0

    Hi Nathan

    On my project i've 2 solution, one with all che code, controllers, composers, ecc... and another with Umbraco website.

    Yesterday i've update plumber version only to my code solution....

    Today, for correcting my mistake i've update plumber version to 408 build, also on my web solution.

    This update caused another strange behavour, now on umbraco interface, any time i open a node i revice this exception:

    Received an error from the server
    An error occured
    Object reference not set to an instance of an object.
    
    Exception Details
    System.NullReferenceException: Object reference not set to an instance of an object.
    Stacktrace
    at Plumber.Web.Components.ContentEventsComponent.EditorModelEventManager_SendingContentModel(HttpActionExecutedContext sender, EditorModelEventArgs`1 e)
       at Umbraco.Web.Editors.EditorModelEventManager.EmitEvent(HttpActionExecutedContext sender, EditorModelEventArgs e) in D:\a\1\s\src\Umbraco.Web\Editors\EditorModelEventManager.cs:line 64
       at Umbraco.Web.WebApi.Filters.OutgoingEditorModelEventAttribute.OnActionExecuted(HttpActionExecutedContext actionExecutedContext) in D:\a\1\s\src\Umbraco.Web\WebApi\Filters\OutgoingEditorModelEventAttribute.cs:line 32
       at System.Web.Http.Filters.ActionFilterAttribute.OnActionExecutedAsync(HttpActionExecutedContext actionExecutedContext, CancellationToken cancellationToken)
    --- End of stack trace from previous location where exception was thrown ---
    

    Do you have any idea?

  • Nathan Woulfe 447 posts 1664 karma points MVP 5x hq c-trib
    Jul 23, 2020 @ 08:08
    Nathan Woulfe
    100

    Yup, I do - it's fixed in 409, which just published. Was checking for excluded nodes, which can only exist on a licensed install.

  • Alessandro Bellisai 30 posts 120 karma points
    Jul 23, 2020 @ 10:31
    Alessandro Bellisai
    0

    Hi Nathan

    It works great!

    Thanks for your support, HFYR

    Alessandro

  • Alessandro Bellisai 30 posts 120 karma points
    Jul 31, 2020 @ 16:29
    Alessandro Bellisai
    0

    Hi Nathan

    I've just realize that i need a license for plumber, so i bought it.

    Please can you give me your email? I need to ask you an invioce, thanks

    Thanks

  • Nathan Woulfe 447 posts 1664 karma points MVP 5x hq c-trib
    Jul 31, 2020 @ 21:02
    Nathan Woulfe
    0

    Hi Alessandro

    I'll get that to you shortly - Stripe should send it automatically, not sure why that's not happening. Thanks for your support!

    N

Please Sign in or register to post replies

Write your reply to:

Draft