How to use a string table value in a destination rule for deployment across environments

  • 24 February 2022
  • 0 replies
  • 9 views

Userlevel 3
Badge +8
 

How to use a string table value in a destination rule for deployment across environments

KB000163

PRODUCT
K2.net 2003
TAGS
Deployment
LEGACY/ARCHIVED CONTENT
This article has been archived, and/or refers to legacy products, components or features. The content in this article is offered "as is" and will no longer be updated. Archived content is provided for reference purposes only. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.

In order to avoid getting an error that reads "The number of installed licenses for K2.net 2003 has been exceeded"; you will need to allow for the limitations of the 10 user development license. K2.net developers can do this by creating mock groups in their development environments that are designed to only ever have 10 test users in them.

 

Introduction

The K2.net 2003 Development license limits the number of destination users for any process to 10 destination users. While processes are under development the following error may be generated, especially for development environments that are exact replicas of the production environment. "The number of installed licenses for K2.net 2003 has been exceeded." To avoid getting this error the developer will need to allow for the limitations of the development license. This can be accomplished by creating mock user groups in the development environment that hold no more users than the license allows. If you are unclear on how the number of users is calculated please refer to the following K2.net Knowledge Base Article article KB000165 - How K2.net evaluates Name User Licenses (NULs). This article describes a technique that uses a combination of string table values and destination rule logic to identify which environment the process is running in and based on that environment, which groups to use.

Assumptions

 
  • You have a project that you need to set up for deployment to 2 or more different environments. (Note: you do not need a separate project for each environment).
  • You have created Active Directory groups (for development purposes) that have a limited number of users in them, but are similar to the true groups that will be used in production.
 

  

 
  
 

Step 1

Create a string table variable that will be used to determine which environment is in use. For example if you wish to deploy to both the development and production environments then you will have a variable named "whichEnvironment" it will either be set to dev or prod depending on which server it is on. You can create the string table variable in K2.net Studio (it looks like this):
 

  

 
Then after you deploy, you will need to go into K2.net Service manager and change the value of the variable according to which server the string table is on. That interface looks like this:
 

  

 

Step 2

Create destination queues for each group that you will need in your process. In the example provided in this article note that an Active Directory group called HR and a corresponding development version of that group HRdev has been created. Create the corresponding destination queues DevQ and ProdQ which will map to these Active Directory groups as well.
 
  
 

Step 3

Create a set of 2 destinations in the destination rule for each activity in your process.
  • In your process map, right click on an activity and choose properties
  • Choose the destination rule option
  • In the left pane create 2 destinations (right click in the right pane and choose "create new destination") destDev and destProd
  • Repeat the above steps for each activity

  

 

Step 4

Assign the DevQ as the destination user for the desDev destination, and assign the prodQ as the destination user for the destProd destination.
  • Expand the destDev destination and drag the devQ user onto the Send To area (Note this group will only be assigned as the destination user - if the string table variable whichEnvironment is set to dev)
  • Expand the destProd destination and drag the prodQ user onto the Send To area (Note this group will only be assigned as the destination user - if the string table variable whichEnvironment is is set to prod)
  
 

Step 5

Configure the rules for the destinations. Use the ellipses for the first variable to look up the string table key for your environment and the second variable should be set to the appropriate Environment Name. Example, if you have deployed to dev you will have set the string table variable to dev on that server, and if you have deployed to production you will set the string table variable to Prod on that server. This rule is checking the string table to determine which environment you are in.
  • Right click on destDev and select Modify Rules
  • Choose the String table whichEnvironment value for the first value
  • Set the Comparison Operator to =
  • Type in dev for the second variable
  • Repeat for the destProd destination
Settings for the development destination rule
 
  
 
  
 

  

 
Settings for the production environment destination rule
 

  

 
  
 
  
 
Now your code will handle the switching between environments based on the value of the StringTable variable whichEnvironment and you won't have to do it manually every time you export.

 


0 replies

Be the first to reply!

Reply