SetWorkflowStatus versus WorkflowManager.MessageWorkflow
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", fa
lse, 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.
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
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?