Starting a Workflow

Initiating a workflow process is a key step in process applications. If you think of a workflow providing a case management solution, A workflow instance may manage a single case or set of cases. A workflow process could correspond 1 to 1 with a Case’s lifecycle OR just a single request related to a case. Other combinations of these are possible as well.

In K2 all the interactions go through a single API. Out of the box assistance provided through the reusable artifacts (be it Infopath, MOSS or forms generation client) also internally use this API to start process instances.

The namespace used is Sourcecode.Workflow.Client and a corresponding DLL is find in the GAC.

using (SourceCode.Workflow.Client.Connection con = new Connection())
{
con.open(”workflowserver”);
ProcessInstance pi = con.CreateProcessInstance(”workflowproject\\workflowprocess”); pi.DataFields["fieldname"].value = “value”;
con.StartProcessInstance(pi);
}

Interaction with the worklfow process instance typically happens when a task is assigned to a user for action. There are two other means for interacting with a process instance as well, which I will cover in another post later.

No Comment

No comments yet

Leave a reply

You must be logged in to post a comment.