Skip to main content

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.

 

 

 

 

 


16900iC20E7342993B1C5C.jpg

Hi, KeithWong


 


I suggest you have a look at the links below which describe the error you have and how you can troubleshoot it.


 



(Note: The above links are not supported by K2, they are from an external source)


 


Hope this helps


 


Regards


 


Julia


Hi Keith,


 


Firstly has anything been changed in your enviroment lately? Secondly can you please check the Configurationmanager.config file in C:ProgramDataSourceCode to see if the Host Name under <plugins> is set to K2 Server?


 


Regards,


 


Yannick


Thank you for your reply.

 

Seems valid host name and port number is already added in Configurationmanager.config.

 

Besides, tried to see following link and it seems not match our scenario.

 


Hi, KeithWong


 


Have a look at this links below:


 



Hope this helps


 


Regards


 


Julia


Check the setting values of the connection string used to connect to the K2 server: host, port number, K2 admin account,K2 admin password.

 

Has anything in the environment recently changed?


Reply