Understanding Environment Libraries
Many organizations have multiple K2 environments, for example Development, Test, QA and Production. These environments usually have different server names, URL’s settings and so on. K2 makes provision for multiple environments with the Environment Library, which is essentially a repository of environment-specific values or "placeholders" for each of your K2 environments. Consider the table below:
Environment Field | Environment | |
---|---|---|
Development | Production | |
SharePoint Portal URL | http://devportal.denallix.com | http://portal.denallix.com |
Email Server | devmail.denallix.com | mail.denallix.com |
When building workflows or SmartForms, designers you may need to interact with different environment fields. Here is an example: Perhaps you want to use a custom environment field in the email step in your workflow.
Create a custom environment field in K2 Management. For the purpose of this example, a new miscellaneous field is created in K2 Management, called Customer Public URL, this field links to URL for customer to access.
In the Email step of your workflow, expand the Context Browser. Expand the Environment Libraries drop down and drag the custom environment field into the body of Email step.
You can also use environment fields in K2 Designer, see the below:
Environment fields are stored on a K2 server, and K2 is “context-aware” at runtime. This means that even if one K2 environment contains multiple copies of the same placeholder for each environment, when the workflow retrieves an environment field at runtime, K2 will know which values to use for the placeholder for the current environment. The currently-active environment is defined by the "Default" setting for the environment.
The default values in the environment library are set up when K2 is installed, but it may be necessary to update these values from time to time. This can be done by the K2 administrator using the K2 Management site. The values are centrally stored on the K2 server.
Environment Fields and Package and Deployment
When dealing with environment fields and Package and Deployment, see the Package and Deployment Considerations topic.