Symptoms
The following error is seen when deploying a workflow from either the K2 smartforms workflow designer or K2 Designer for SharePoint 2013:
System.Exception: The ''environment name]' environment does not exist on Default Template template.
at SourceCode.WebDesigner.Authoring.Forms.GenerateProcess.SetupEnvironmentFields()
at SourceCode.WebDesigner.Authoring.Forms.GenerateProcess.ProcessSetup(DefaultProcessand newProcess, XmlDocument InputData, XmlDocument xmlProcess, String ProcessName, String ProjectName, String UserName)
at SourceCode.WebDesigner.Authoring.Forms.GenerateProcess.Generate(String LocalHostConnection, String UserName, Int32 ProcessID, String InputData, String ProcessXML, String SqlConnectionString, String HostServerConnectionString)
Diagnoses
This item at first glance seems to be related to the Environment Library templates for the environment being deployed against, or configuration thereof.
-Double check that the default environment library template is indeed the desired template by doing so in the Workspace Management Console>Environment Library>Templates>Environments. Make sure the template you have deemed the default for your environment is marked as "True" under the default column
-Does the template mentioned in the error actually exist in the environment you are deploying against? It's a good idea to pay attention to both the environment the error is referencing as well as the spelling of the environment itself. This could help lead you to where the configuration problem lies.
Resolution
If the items mentioned in the Diagnosis section are properly configured, then the problem may lie in the K2 smartforms Designer Workflow web.config file:
1. Browse to the hinstall drive]:ProgramFiles (x86)K2 blackpearlK2 smartforms DesignerWorkflow folder and open the web.config file.
2. Search for "CurrentEnvironment" and make sure the name accurately reflects the environment template that is defined as the default for the environment.
3. Save the edits made to the file (if any). An IIS reset can be performed on the K2 Server, but should not be necessary
4. Try deploying again and see if the behavior persists.
If the behavior does persist, please contact K2 Technical Support via the support ticketing system.