Environment Library API

  • 4 March 2008
  • 2 replies
  • 8 views

Badge +2

Hi All,


I've got a process developed and wondered if I could write some custom code (in a windows or console app) to re-create the Environment Settings in the Workspace on the new environment.  I can't find any class reference or guidance.  I've got this far ...


// get the environment fields


EnvironmentFieldCollection

fields = envManager.CurrentEnvironment.EnvironmentFields;


// add a field 


fields.Add(...);


// save the updates 


bool success = envManager.CurrentEnvironment.SaveUpdate();


 


I'm stuck around what types of fields to add and the classes they use.  I cant use EnvironmentField as its an abstract class.


Any ideas?


Thanks


Dave


2 replies

Badge +11

How about using a deployment package to move your environment settings to another server?  Open a workflow project in Visual Studio, right-click on the project and choose "Create Deploy Package".  The deployment package will reside under your project's objdebugdeployment folder.  Here's a link to a KB article:


http://kb.k2workflow.com/articles/kb000188.aspx

Badge +8

If anybody else is interested in how to create environment fields with code, I have a small bog entry on how to do it:


http://www.deonsmit.com/2009/04/creating-k2-environment-fields-with.html


 

Reply