Class WorkflowInstanceService

Reads the SharePoint workflow instances from the external workflow host and manages the instance execution.

Hierarchy

Index

Methods

Methods

public cancelWorkflow(instance: WorkflowInstance)

Sends a cancel message to the specified workflow instance and permits the instance to execute a cancellation scope.

Parameters

public countInstances(parentSubscription: WorkflowSubscription): IntResult

Retrieves a count of all the instances of the specified WorkflowSubscription.

Parameters

Returns

IntResult

public countInstancesWithStatus(parentSubscription: WorkflowSubscription, status: WorkflowStatus): IntResult

Retrieves a count of the instances of the specified WorkflowSubscription that have a specified status.

Parameters

Returns

IntResult

public customFromJson(initValue: any): boolean

Parameters

  • initValue: any

Returns

boolean

public enumerate(parentSubscription: WorkflowSubscription): WorkflowInstanceCollection

Gets a workflow instance collection comprising the 100 most recent workflow instances started by a specified subscription.

Parameters

Returns

WorkflowInstanceCollection

public enumerateInstancesForListItem(listId: string, itemId: number): WorkflowInstanceCollection

Gets the list of instances for the specified list item.

Parameters

  • listId: string
  • itemId: number

Returns

WorkflowInstanceCollection

public enumerateInstancesForListItemWithOffset(listId: string, itemId: number, offset: number): WorkflowInstanceCollection

Gets the list of instances for the specified list item.

Parameters

  • listId: string
  • itemId: number
  • offset: number

Returns

WorkflowInstanceCollection

public enumerateInstancesForSite(): WorkflowInstanceCollection

Gets the list of instances for the current site.

Returns

WorkflowInstanceCollection

public enumerateInstancesForSiteWithOffset(offset: number): WorkflowInstanceCollection

Gets the list of instances for the current site.

Parameters

  • offset: number

Returns

WorkflowInstanceCollection

public enumerateWithOffset(parentSubscription: WorkflowSubscription, offset: number): WorkflowInstanceCollection

Gets a workflow instance collection comprising 100 workflow instances starting at the specified offset.

Parameters

Returns

WorkflowInstanceCollection

public fromJson(initValue: any)

Parameters

  • initValue: any

public getDebugInfo(instance: WorkflowInstance): StringResult

Parameters

Returns

StringResult

public getInstance(instanceId: string): WorkflowInstance

Gets workflow instance specified by the provided instance GUID

Parameters

  • instanceId: string

Returns

WorkflowInstance

public get_context(): ClientRuntimeContext

Returns

ClientRuntimeContext

public get_objectVersion(): string

Returns

string

public get_path(): ObjectPath

Returns

ObjectPath

public get_serverObjectIsNull(): boolean

Returns

boolean

public get_typedObject(): ClientObject

Returns

ClientObject

public isObjectPropertyInstantiated(propertyName: string): boolean

Parameters

  • propertyName: string

Returns

boolean

public isPropertyAvailable(propertyName: string): boolean

Parameters

  • propertyName: string

Returns

boolean

public publishCustomEvent(instance: WorkflowInstance, eventName: string, payload: string)

Sends a custom event to a running workflow with the event payload.

Parameters

public refreshLoad()

public resumeWorkflow(instance: WorkflowInstance)

Parameters

public retrieve()

public retrieve(propertyNames: Array<string>)

Parameters

  • propertyNames: Array<string>

public set_objectVersion(value: string)

Parameters

  • value: string

public startWorkflow(subscription: WorkflowSubscription, payload: { [name: string]: any; }): GuidResult

Starts a Workflow Manager Client 1.0 instance specified by the subscription and passes the supplied parameters. Returns GUID of the instance object.

Parameters

  • subscription: WorkflowSubscription
  • payload: { [name: string]: any; }

    Object that contains name-value pairs of parameter names and values to pass into the workflow instance.

Returns

GuidResult

public startWorkflowOnListItem(subscription: WorkflowSubscription, itemId: number, payload: { [name: string]: any; }): GuidResult

Starts a Workflow Manager Client 1.0 instance specified by the subscription and passes the supplied parameters. Returns GUID of the instance object.

Parameters

  • subscription: WorkflowSubscription

    The subscription associated with the workflow instance.

  • itemId: number

    The integer id of the list item on which to start the workflow instance.

  • payload: { [name: string]: any; }

    Object that contains name-value pairs of parameter names and values to pass into the workflow instance.

Returns

GuidResult

public suspendWorkflow(instance: WorkflowInstance)

Parameters

public terminateWorkflow(instance: WorkflowInstance)

Terminate a workflow instance forcefully by deleting it from memory. The instance is not allowed to execute a cancellation scope

Parameters