Samples

These samples demonstrate basic and common uses of the Workflow Client API

Sample Projects

Sample Project
You can use the following sample project for examples of common uses of the Workflow Client API. K2Documentation.Samples.WorkflowRuntime.WorkflowClientAPI (on GitHub).The sample project is provided for demonstration purposes only. It is not supported by the product and is not intended to be used as-is in production environments.

Code Samples

The topics listed in the table below contain code samples that demonstrate specific uses of the Workflow Client API.

Topic Description
Workflow Client Connections Demonstrates how to work with SourceCode.Workflow.Client.Connection.

Start an instance of a workflow

Start an instance of a workflow.

Retrieve the worklist

Retrieve the worklist items for the connected user.

Retrieve the worklist with WorklistCriteria

Retrieve the worklist items for the connected user, using Worklist Criteria to filter and sort the worklist items server-side.
Open and complete a WorklistItem Open a worklist item, update some data in the process instance and then complete the worklist item by executing an action.
Open delegated worklist items or managed user worklist items Shows how to work with delegated, shared or subordinates' worklist items
Impersonate a user Shows how to impersonate another user when you are unable to connect with that user's native credentials.
Access the View Flow URL Shows how to access the View Flow URL
Using the Workflow Client API with Windows Powershell Demonstrates how to use Windows Powershell to start a workflow
Impersonate a user How to impersonate a user after establishing a connection to the product

Set a user's Out of Office Status

Setting a user's Out of Office Status
Asynchronous Server Events How to build asynchronous server tasks, where an external system will complete a server task
Work with comments and attachments How to work with the Workflow Comments and Attachments objects