Hi,
We are working on updating the properties of one of the Review workflow associated with a site content type and pushing the changes to relevant list CTs and the child CTs inherting the content type. Here is the code snippet. But the below code works only for site Content Type but doesn't propagate changes to child CTs and list CTs.
The propagation works if we make the changes directly through the UI. But doesn't work through object model or powershell. Any clue or any help is much appreciated
SPSecurity.RunWithElevatedPrivileges(delegate(){
using (SPSite site = new SPSite("sitenamef"))
{
using (SPWeb web = site.OpenWeb())
{
SPContentType ct = web.ContentTypes["CTName"];
SPWorkflowAssociation workflowassocation = ct.WorkflowAssociations.GetAssociationByName("Review", web.Locale);
Console.WriteLine(workflowassocation.AssociationData);
workflowassocation.AssociationData.Replace(">Serial<", ">Parallel<");
ct.WorkflowAssociations.Update(workflowassocation);
ct.UpdateWorkflowAssociationsOnChildren(true, true, true, true);
Console.WriteLine(workflowassocation.AssociationData);
ct.Update(true);
}
}
});