Hi everyone, I created the workflow for afternoon demo and it's works fine in past 2 months.
This morning, I got workflow error when I try to get SN / connect to K2, may I ask your advice?
Version: k2 black pearl 4.6.4
Development Tool: MS VS 2012
-------- Error Message.-----------
System.Net.Sockets.SocketException: A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied; at System.Net.Sockets.Socket.Shutdown(SocketShutdown how); at SourceCode.Hosting.Client.BaseAPI.SocketBaseAPIConnection.OnClose(); at SourceCode.Hosting.Client.BaseAPI.BaseAPIConnection.Close(); at SourceCode.Hosting.Client.BaseAPI.BaseAPIConnectionBroker.OnClose(); at SourceCode.Hosting.Client.BaseAPI.BaseAPIConnection.Close(); at XXX.GetSN(String Host, UInt32 Port, String ProcessName, String K2Admin, String K2AdminPassword, String RequestID); at XXX.frmNewCase.WorkflowProceed(String EmailTemplate, Int32 Scheme, String WorkflowPortfolio, Int32 intCaseID, String Action); at XXX.frmCaseDetails.SubmitApproval()
-------- Please reference following code blocks for your reference.-----------
//Caller
string _SN = GetSN(Host, Port, strWorkflowName, K2Admin, K2Password, WorkflowPortfolio);
//Helper Class
/// <summary>
/// Get SN
/// </summary>
public static string GetSN(string Host, uint Port, string ProcessName, string K2Admin, string K2AdminPassword, string RequestID)
{
string ret = "";
SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder connectionString = new SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder();
connectionString.Authenticate = true;
connectionString.Host = Host;
connectionString.Integrated = true;
connectionString.IsPrimaryLogin = true;
connectionString.Port = Port;
connectionString.UserID = K2Admin;
connectionString.Password = K2AdminPassword;
WorkflowManagementServer WorkflowServer = new WorkflowManagementServer();
try
{
WorkflowServer.CreateConnection();
WorkflowServer.Connection.Open(connectionString.ToString());
WorklistItems items = WorkflowServer.GetWorklistItems("", ProcessName, "", "", RequestID, "", "");
if (items.Count > 0)
{
ret = itemse0].ProcInstID.ToString() + "_" + items_0].ActInstDestID.ToString();
return ret;
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
WorkflowServer.Connection.Close();
}
return ret;
}
Thank you very much for attention.