Search Results for

    Show / Hide Table of Contents

    Class WorkflowExtensions

    Class for workflow extension methods

    Inheritance
    System.Object
    WorkflowExtensions
    Namespace: Microsoft.SharePoint.Client
    Assembly: PnP.Framework.dll
    Syntax
    public static class WorkflowExtensions : object

    Methods

    AddWorkflowDefinition(Web, WorkflowDefinition, Boolean)

    Adds a workflow definition

    Declaration
    public static Guid AddWorkflowDefinition(this Web web, WorkflowDefinition definition, bool publish = true)
    Parameters
    Web web

    the target web

    WorkflowDefinition definition

    the workflow definition to add

    System.Boolean publish

    specify true to publish workflow definition

    Returns
    Guid

    AddWorkflowSubscription(List, String, String, Boolean, Boolean, Boolean, String, String, Dictionary<String, String>)

    Adds a workflow subscription

    Declaration
    public static Guid AddWorkflowSubscription(this List list, string workflowDefinitionName, string subscriptionName, bool startManually, bool startOnCreate, bool startOnChange, string historyListName, string taskListName, Dictionary<string, string> associationValues = null)
    Parameters
    List list

    The target list

    System.String workflowDefinitionName

    The name of the workflow definition WorkflowExtensions.GetWorkflowDefinition

    System.String subscriptionName

    The name of the workflow subscription to create

    System.Boolean startManually

    if True the workflow can be started manually

    System.Boolean startOnCreate

    if True the workflow will be started on item creation

    System.Boolean startOnChange

    if True the workflow will be started on item change

    System.String historyListName

    the name of the history list. If not available it will be created

    System.String taskListName

    the name of the task list. If not available it will be created

    Dictionary<System.String, System.String> associationValues

    the name-value pairs for workflow definition

    Returns
    Guid

    Guid of the workflow subscription

    AddWorkflowSubscription(List, WorkflowDefinition, String, Boolean, Boolean, Boolean, String, String, Dictionary<String, String>)

    Adds a workflow subscription to a list

    Declaration
    public static Guid AddWorkflowSubscription(this List list, WorkflowDefinition workflowDefinition, string subscriptionName, bool startManually, bool startOnCreate, bool startOnChange, string historyListName, string taskListName, Dictionary<string, string> associationValues = null)
    Parameters
    List list

    The target list

    WorkflowDefinition workflowDefinition

    The workflow definition. WorkflowExtensions.GetWorkflowDefinition

    System.String subscriptionName

    The name of the workflow subscription to create

    System.Boolean startManually

    if True the workflow can be started manually

    System.Boolean startOnCreate

    if True the workflow will be started on item creation

    System.Boolean startOnChange

    if True the workflow will be started on item change

    System.String historyListName

    the name of the history list. If not available it will be created

    System.String taskListName

    the name of the task list. If not available it will be created

    Dictionary<System.String, System.String> associationValues

    the name-value pairs for workflow definition

    Returns
    Guid

    Guid of the workflow subscription

    CancelWorkFlow(WorkflowInstance)

    Cancels a workflow instance

    Declaration
    public static void CancelWorkFlow(this WorkflowInstance instance)
    Parameters
    WorkflowInstance instance

    the workflow instance to cancel

    Delete(WorkflowDefinition)

    Deletes a workflow definition

    Declaration
    public static void Delete(this WorkflowDefinition definition)
    Parameters
    WorkflowDefinition definition

    the workflow defition to delete

    Delete(WorkflowSubscription)

    Deletes the subscription

    Declaration
    public static void Delete(this WorkflowSubscription subscription)
    Parameters
    WorkflowSubscription subscription

    the workflow subscription to delete

    GetInstances(WorkflowSubscription)

    Returns all instances of a workflow for this subscription

    Declaration
    public static WorkflowInstanceCollection GetInstances(this WorkflowSubscription subscription)
    Parameters
    WorkflowSubscription subscription

    the workflow subscription to get instances

    Returns
    WorkflowInstanceCollection

    Returns a WorkflowInstanceCollection object

    GetWorkflowDefinition(Web, Guid)

    Returns a workflow definition

    Declaration
    public static WorkflowDefinition GetWorkflowDefinition(this Web web, Guid id)
    Parameters
    Web web

    the target web

    Guid id

    the id of workflow definition

    Returns
    WorkflowDefinition

    Returns a WorkflowDefinition object

    GetWorkflowDefinition(Web, String, Boolean)

    Returns a workflow definition for a site

    Declaration
    public static WorkflowDefinition GetWorkflowDefinition(this Web web, string displayName, bool publishedOnly = true)
    Parameters
    Web web

    the target web

    System.String displayName

    the workflow definition display name, which is displayed to users

    System.Boolean publishedOnly

    Defines whether to include only published definition, or all the definitions

    Returns
    WorkflowDefinition

    Returns a WorkflowDefinition object

    GetWorkflowDefinitions(Web, Boolean)

    Returns all the workflow definitions

    Declaration
    public static WorkflowDefinition[] GetWorkflowDefinitions(this Web web, Boolean publishedOnly)
    Parameters
    Web web

    The target Web

    Boolean publishedOnly

    Defines whether to include only published definition, or all the definitions

    Returns
    WorkflowDefinition[]

    Returns all WorkflowDefinitions

    GetWorkflowInstances(Web)

    Returns alls workflow instances for a site

    Declaration
    public static WorkflowInstanceCollection GetWorkflowInstances(this Web web)
    Parameters
    Web web

    the target web

    Returns
    WorkflowInstanceCollection

    Returns a WorkflowInstanceCollection object

    GetWorkflowInstances(Web, ListItem)

    Returns alls workflow instances for a list item

    Declaration
    public static WorkflowInstanceCollection GetWorkflowInstances(this Web web, ListItem item)
    Parameters
    Web web

    the target web

    ListItem item

    the target list item to get workflow instances

    Returns
    WorkflowInstanceCollection

    Returns a WorkflowInstanceCollection object

    GetWorkflowSubscription(List, String)

    Returns a workflow subscription (associations) for a list

    Declaration
    public static WorkflowSubscription GetWorkflowSubscription(this List list, string name)
    Parameters
    List list

    The target list

    System.String name

    Name of workflow subscription to get

    Returns
    WorkflowSubscription

    Returns a WorkflowSubscription object

    GetWorkflowSubscription(Web, Guid)

    Returns a workflow subscription

    Declaration
    public static WorkflowSubscription GetWorkflowSubscription(this Web web, Guid id)
    Parameters
    Web web

    The web to get workflow subscription

    Guid id

    The id of the workflow subscription

    Returns
    WorkflowSubscription

    Returns a WorkflowSubscription object

    GetWorkflowSubscription(Web, String)

    Returns a workflow subscription for a site.

    Declaration
    public static WorkflowSubscription GetWorkflowSubscription(this Web web, string name)
    Parameters
    Web web

    The web to get workflow subscription

    System.String name

    The name of the workflow subscription

    Returns
    WorkflowSubscription

    Returns a WorkflowSubscription object

    GetWorkflowSubscriptions(Web)

    Returns all the workflow subscriptions (associations) for the web and the lists of that web

    Declaration
    public static WorkflowSubscription[] GetWorkflowSubscriptions(this Web web)
    Parameters
    Web web

    The target Web

    Returns
    WorkflowSubscription[]

    Returns all WorkflowSubscriptions

    PublishCustomEvent(WorkflowInstance, String, String)

    Publish a custom event to a target workflow instance

    Declaration
    public static void PublishCustomEvent(this WorkflowInstance instance, string eventName, string payload)
    Parameters
    WorkflowInstance instance

    the workflow instance to publish event

    System.String eventName

    The name of the target event

    System.String payload

    The payload that will be sent to the event

    ResumeWorkflow(WorkflowInstance)

    Resumes a workflow

    Declaration
    public static void ResumeWorkflow(this WorkflowInstance instance)
    Parameters
    WorkflowInstance instance

    the workflow instance to resume

    StartWorkflowInstance(ListItem, Guid, IDictionary<String, Object>)

    Starts a new instance of a workflow definition against the current item

    Declaration
    public static Guid StartWorkflowInstance(this ListItem item, Guid subscriptionId, IDictionary<String, Object> payload)
    Parameters
    ListItem item

    The target item

    Guid subscriptionId

    The ID of the workflow subscription to start

    IDictionary<String, Object> payload

    Any input argument for the workflow instance

    Returns
    Guid

    The ID of the just started workflow instance

    StartWorkflowInstance(ListItem, String, IDictionary<String, Object>)

    Starts a new instance of a workflow definition against the current item

    Declaration
    public static Guid StartWorkflowInstance(this ListItem item, string subscriptionName, IDictionary<string, object> payload)
    Parameters
    ListItem item

    The target item

    System.String subscriptionName

    The name of the workflow subscription to start

    IDictionary<System.String, System.Object> payload

    Any input argument for the workflow instance

    Returns
    Guid

    The ID of the just started workflow instance

    StartWorkflowInstance(Web, Guid, IDictionary<String, Object>)

    Starts a new instance of a workflow definition against the current web site

    Declaration
    public static Guid StartWorkflowInstance(this Web web, Guid subscriptionId, IDictionary<String, Object> payload)
    Parameters
    Web web

    The target web site

    Guid subscriptionId

    The ID of the workflow subscription to start

    IDictionary<String, Object> payload

    Any input argument for the workflow instance

    Returns
    Guid

    The ID of the just started workflow instance

    StartWorkflowInstance(Web, String, IDictionary<String, Object>)

    Starts a new instance of a workflow definition against the current web site

    Declaration
    public static Guid StartWorkflowInstance(this Web web, string subscriptionName, IDictionary<string, object> payload)
    Parameters
    Web web

    The target web site

    System.String subscriptionName

    The name of the workflow subscription to start

    IDictionary<System.String, System.Object> payload

    Any input argument for the workflow instance

    Returns
    Guid

    The ID of the just started workflow instance

    Back to top PnP Framework
    Generated by DocFX with Material UI
    spacer