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 K2 product support 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.

Starting an instance of a workflow

Start an instance of a workflow.

Retrieving the worklist

Retrieve the worklist items for the connected user.

Retrieving the worklist with WorklistCriteria

Retrieve the worklist items for the connected user, using Worklist Criteria to filter and sort the worklist items server-side.
Opening and completing a WorklistItem Open a worklist item, update some data in the process instance and then complete the worklist item by executing an action.
Opening delegated worklist items or managed user worklist items Shows how to work with delegated, shared or subordinates' worklist items
Impersonating a User Shows how to impersonate another user when you are unable to connect with that user's native credentials.
Accessing 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
Impersonating a User How to impersonate a user after establishing a connection to K2

Setting 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
Working with Comments and Attachments How to work with the Workflow Comments and Attachments objects