none
Cannot tell whether a workflow association is reusable RRS feed

  • Question

  • Hi,

    I have a list content type object with workflow associations (SPWorkflowAssociationCollection  SPContentType.WorkflowAssociations).

    I need to go over the WF associations and decide which of them is a reusable workflow and which is a template workflow. I found no property or hint in SPWorkflowAssociation (including parsing SoapXml property) that can tell the difference.

    Any idea how to tell whether a SPWorkflowAssociation object (under a list content type) is reusable or not?

    Thanks in advance

    Monday, June 21, 2010 12:07 PM

Answers

  • Hi Sruli,

    If I understand correctly, you want to find out if the underlying SPWorkflowTemplate of an association is a reusable workflow? You can check this by looking at the Visibility property of the workflow template:

    if((string)workflowAssociation.BaseTemplate["Visibility"] == "Public") 
    //it's reusable
    
    if((string)workflowAssociation.BaseTemplate["Visibility"] == "RootPublic") 
    //it's globally reusable
    
    

    Hope that helps,

    Daniel McAllister--MSFT

    • Marked as answer by Sruli I.Ganor Tuesday, June 22, 2010 2:26 PM
    Tuesday, June 22, 2010 12:58 AM

All replies

  • Hi Sruli,

    If I understand correctly, you want to find out if the underlying SPWorkflowTemplate of an association is a reusable workflow? You can check this by looking at the Visibility property of the workflow template:

    if((string)workflowAssociation.BaseTemplate["Visibility"] == "Public") 
    //it's reusable
    
    if((string)workflowAssociation.BaseTemplate["Visibility"] == "RootPublic") 
    //it's globally reusable
    
    

    Hope that helps,

    Daniel McAllister--MSFT

    • Marked as answer by Sruli I.Ganor Tuesday, June 22, 2010 2:26 PM
    Tuesday, June 22, 2010 12:58 AM
  • Thanks Daniel. It certainly helps. There is no way I could have found it myself.
    Tuesday, June 22, 2010 2:27 PM