More in this section

Forums / Developing with Sitefinity / SetWorkflowStatus versus WorkflowManager.MessageWorkflow

SetWorkflowStatus versus WorkflowManager.MessageWorkflow

3 posts, 0 answered
  1. Merritt
    Merritt avatar
    31 posts
    Registered:
    11 Mar 2011
    09 Jun 2015
    Link to this post

    I am trying to grasp the concepts behind workflow and lifecycle in sitefinity, and am running into some issues concerning the difference between:

     

    dynamicContent.SetWorkflowStatus(DynamicModuleManager.Provider.ApplicationName, "Published");

    and 

    var bag = new Dictionary<string, string> { { "ContentType", Type.FullName } };
    WorkflowManager.MessageWorkflow(dynamicContent.Id, Type, null, "Publish", false, bag);

    It seems the first line creates 1 record in sf_dynamic_content and the second line will create 2.

     After some more testing, I found that youc an recreate the behavior of using the WorkflowManager by adding:

    _dynamicModuleManager.Lifecycle.Publish(dynamicContentItem);

    after SetWorkFlowStatus.

     what if you want to save as a draft programmatically? that only creates one record if you just use SetWorkFlowStatus, then save. However, if you do this through the backend, meaning create a content item and save as draft, you get 2 records.

     

     

  2. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    06 Sep 2017
    12 Jun 2015
    Link to this post
    Hello Merritt,

    You can find more information about the Workflow statuses and the Content Lifecycle here:
    Workflow statuses
    Content lifecycle

    Generally speaking - when you save the Item as draft you have one Master version. On publish you have two records - Master and Live (Master with visibility true) versions.

    Regards,
    Svetoslav Manchev
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  3. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    23 Jan
    Link to this post

    so am I correct in interpreting what you're saying here is that if you use MessageWorklfow, Sitefinity will create a snapshot of master, and set its status to live...

    But if you use Lifecycle.Publish, the master item itself will be updated to be the live, so there is no master.

    Is that correct? if there is no master, just live what happens if you edit it again, does it create a copy of live as a new master?

3 posts, 0 answered