Try Now
More in this section

Forums / Developing with Sitefinity / SetWorkflowStatus versus WorkflowManager.MessageWorkflow

SetWorkflowStatus versus WorkflowManager.MessageWorkflow

2 posts, 0 answered
  1. Merritt
    Merritt avatar
    31 posts
    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");


    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:


    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
    17 Oct 2016
    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.

    Svetoslav Manchev
    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
2 posts, 0 answered