Skip to main content

Is there a way to choose the environment to spawn a process instance in? e.g. if Process1 was deployed to both Development and Production on the same server, how do you determine which environment to execute Process1 in when starting it with StartProcessInstance().

You can set data fields in your code and start the process instance against your chosen server. The code will look something like this.






string _serverName = "PROD-MYCOMPANY";
string _processName = "K2WorkflowProject1Process1";
connection.Open(_serverName, connectionString.ToString());
ProcessInstance processInstance = connection.CreateProcessInstance(_processName);
connection.StartProcessInstance(processInstance, false);

 


With the above code, you will start Process1 on PROD-MYCOMPANY server


Reply