How can I define some values in Key Data (e.g. UserCount, LockCount), and can upgrade the values via Activation Server?
Here is how you can use the Products and Upgrades tables to achieve what you need to licensing UserCount and LockCount via Key Data without having to modify the code.
Please see the screenshots.
First you define 050 for UserCount and 060 for LockCount in the KeyData, and then generate the MasterLicense, and enter it for a product in the Products table.
You define 010 for UserCount upgrade and 005 for LockCount upgrade (for example). Also, enable the “Add to Existing KeyData” option. Then generate the MasterLicense, and enter it as an upgrade in the Upgrades table.
When a user makes a purchase, you create an account and link it to the product 50UserCount-60LockCount. When the user activates the license, he can use the program with 50 UserCount and 60 LockCount. Your program would get the KeyData via the API.
When the user upgrades for 10 usercount and 5 lockcount, you would go to the user's account Control page. Select from the Upgrades table for 10UserCount-50LockCount Upgrade. Then, click the Upgrade Product button. The 10-UserCount and 5-LockCount will be added to the current license, which results the new license with KeyData: 50 + 10 = 60 UserCount, 60 + 5 = 65 LockCount. When the user activates the license again, the upgrade will be applied to your program (i.e. your program would get the new Key Data via the API).