Symptoms
We are getting exceptions when calling StartNewProcessInstance:
System.Net.WebException occurred
HResult=-2146233079
Message=The remote server returned an error: (500) Internal Server Error.
Source=System
StackTrace:
at System.Net.HttpWebRequest.GetResponse()
InnerException:
System.ServiceModel.FaultException`1 occurred
HResult=-2146233087
Message=The ViewFlow URL could not be found. Ensure the Workflow URL Environment field exists.
Source=System.ServiceModel
StackTrace:
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpcandamp rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Objectt] ins, Objectt] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at 0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
InnerException:
Both variables that it is requesting seem to exist both in the "environment" and in the process' string table (see attachment).
It seems that the process is actually started but is not correctly handled by our application (K2 sees it "active" where our application sees it "running" and will thus not let us do anything). I would like to first resolve this error and then look at that if it still occurs afterwards.
This code and workflow work in development so we think it's a configuration issue but we cannot work out where.
Diagnoses
Issue generally linked to Environment variable setup : No default environment setup.
Resolution
Could you go in Workspace andgt Management Console andgt Environment Library andgt Templates andgt Default Template and check if one Environment to "Default" to "True"? If no, please set the good one as Default=True