Introduction

An unhandled exception occurs when calling the Process Instance Object in SourceCode.Workflow.Client API.

Error Scenario

Note: The circumstances described in this article are one scenario under which this issue may, or is known to occur. The description is intended to be specific to the scenario described and does not take into account all possible scenarios or circumstances.

To reproduce this error:

  1. Create a simple process and deploy
  2. Create a custom application with the following code:
  3. ProcessInstance pi = connection.CreateProcessInstance(myProcessName);
    connection.StartProcessInstance(pi);
    connection.OpenProcessInstance(pi.ID);
  4. Run the application
  5. The process will start, but an error will occur on the third line of the code snippet


Error Message
Object reference not set to an instance of an object.

Error Resolution
This Hotfix is contained within the latest K2 Update. Install the update package to resolve the error.