We have developped a new K2 Workflow but find some performance issue, we use client event to bind some ASP.NET Page in our project. system hardware is powerful, and system resource is enough.
After debugging step by step, we found the codes below execute very slowly.
The first is the code to open a connection to K2 Server:
Connection conn = new Connection();
//create connection string
SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder builder = new SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder();
builder.Host = "localhost";
builder.Port = 5252;
builder.SecurityLabelName = "K2";
builder.Authenticate = true;
builder.IsPrimaryLogin = true;
builder.Integrated = true;
// Connect to Workflow Server
conn.Open("localhost", builder.ConnectionString);
the line in yellow highlight takes nearly 64 seconds to execute. We have to open connection to K2 Server for many interaction.
The second is the code to create workflow instance, as below. It takes nearly 55 seconds to go to next step:
ProcessInstance pi = conn.CreateProcessInstance(name);
The third is when we open worklist for the workflow receiver after it is launched, it also takes about 65 seconds:
WorklistItem wi = conn.OpenWorklistItem(sn);
The other codes line only takes several seconds at most, the execution of this three lines occupy the most time of page loading or submitting.
can anyone give me some suggestions on this performance issue?
Thanks