Symptoms
When deploying a workflow from K2 Designer for SharePoint (SharePoint 2010), users get the error:
System.Exception: System.Exception: The ViewFlowUrl field does not exist in the environment.
at DynamicEvents.GetEnvironmentWorkspaceUrl(Stringg] eventDropData, K2Field SmartObjectServer, K2Field currentField, String CurrentEnvironment)
at DynamicEvents.GetWorkflowContextFieldPart(Stringg] eventDropData, K2Field SmartObjectServer, K2Field currentField, String CurrentEnvironment, Boolean html)
at DynamicEvents.GetResolverValueForExpression(String Data, Process newProcess, Activity newActivity, K2Field SmartObjectServer, String ContextType, K2Field CurrentK2Field, Boolean SimpleExpression, String CurrentEnvironment, Boolean Html, String style, String fontFamily, String fontSize, String fontStyle, String fontWeight, String fontUnderline)
at DynamicEvents.GetResolverValueForExpression(String Data, Process newProcess, Activity newActivity, K2Field SmartObjectServer, String ContextType, K2Field CurrentK2Field, Boolean SimpleExpression, String CurrentEnvironment, Boolean Html, String style, String fontFamily, String fontSize, String fontStyle, String fontWeight, String fontUnderline)
at DynamicEvents.GetValue(String Data, Process newProcess, Activity newActivity, K2Field SmartObjectServer, String ContextType, Boolean Html, String CurrentEnvironment, String style, String fontFamily, String fontSize, String fontStyle, String fontWeight, String fontUnderline)
at DynamicEvents.GetValue(String Data, Process newProcess, Activity newActivity, K2Field SmartObjectServer, String ContextType, Boolean Html, String CurrentEnvironment)
at DynamicEvents.SetPropertySubValue(Object procDef, XmlNode PropertyNode, XmlDocument xmlProcess, Process newProcess, Activity newActivity, Type propTypeDefProp, PropertyInfo propInfoDefProp, Object eventItem, String CurrentEnvironment)
at DynamicEvents.SetPropertyValue(Object procDef, XmlNode PropertyNode, XmlDocument xmlProcess, Process newProcess, Activity newActivity, Type propTypeDefProp, PropertyInfo propInfoDefProp, Object eventItem, String CurrentEnvironment)
at DynamicEvents.BuildEvent(XmlNode xml, Process newProcess, XmlNode activity, Activity newActivity, XmlDocument xmlProcess, K2Field SmartObjectServer, String ContextType, String _SmartObjectServer, String CurrentEnvironment)
at SourceCode.WebDesigner.Authoring.SharePoint.GenerateProcess.CreateDynamicEvents(XmlDocument xmlProcess, XmlNode activity, Activity newActivity, Process newProcess, String UserName)
at SourceCode.WebDesigner.Authoring.SharePoint.GenerateProcess.CreateActivies(XmlDocument xmlInputData, XmlDocument xmlProcess, DefaultProcessand newProcess, String UserName)
at SourceCode.WebDesigner.Authoring.SharePoint.GenerateProcess.Generate(String UserName, Int32 ProcessID, String InputData, String ProcessXML, String ConnectionString)
at SourceCode.WebDesigner.Authoring.SharePoint.GenerateProcess.Generate(String UserName, Int32 ProcessID, String InputData, String ProcessXML, String ConnectionString)
Diagnoses
N/A
Resolution
There was a missing environment field ‘Workspace Url’. Adding workspace url and setting as default field resolved the issue.
(K2Workspace > Management > K2server_name > Environment Library > Templates > Default Templates > Environments > Environment_name > Environment Fields > right click and add Workspace URL and set as default workspace url).