Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Manage Licensing with Foundation Subsystems Part 2

No ratings


Step 5: Add Data


Now that our Mashup's Layout and Widgets have been set, we need to bring in backend data and tie it to those Widgets for display. 


We'll make use of Mashup Data Services for this. The first one we'll add will be UserManagementSubsystem > GetUserCount.


  1. Ensure that the Data tab in the top-right is active.



  2. Click the + icon.



  3. In the Entity field, search for and select UserManagementSubsystem.



  4. In the Services field, type GetUserCount.



  5. Beside the GetUserCount Service, click the right arrow.
  6. Under Selected Services, check the box for Execute on Load.




Add LicensingSubsystem > GetCurrentLicenseInfo


You're not limited to only pulling information from one Mashup Data Service.


We already have User Management's GetUserCount. We'll now also bring in information from the Licensing Subsystem.


  1. On the same Add Data pop-up, click the X beside UserManagementSubsystem to clear it.



  2. In the Entity field, search for and select LicensingSubsystem.



  3. In the Services field, type GetCurrentLicenseInfo.



  4. Beside GetCurrentLicenseInfo, click the right arrow.
  5. Under Selected Services on the GetCurrentLicenseInfo line, check the box for Execute on Load.



  6. On the bottom-right of the pop-up, click Done.



  7. At the top, click Save.


Bind Data


With our backend data now accessible, let's bind it to our Widgets for display.


  1. On the Data tab, expand Subsystems_LicensingSubsystem > GetCurrentLicenseInfo > Returned Data.



  2. Drag-and-drop Licensing's All Data onto the Grid Advanced Widget in the bottom section.



  3. On the Select Binding Target pop-up, click Data.



  4. Expand Subsystems_UserManagementSubsystem > GetUserCount > Returned Data > All Data.



  5. Drag-and-drop User Management's result onto the Text Field Widget in the top section.



  6. On the Select Binding Target pop-up, click Text.



  7. At the top, click Save.


Automatically Refresh


If we were to click View Mashup now, we would see the User Count and Licensing info displayed in the Mashup's Widgets. However, it would never update unless we manually refreshed the page.


To automate that process, we'll use the Auto Refresh Widget.


  1. In the top section of the Mashup, click the Auto Refresh Widget to select it.



  2. On the top-left of the Auto Refresh Widget, click the drop-down icon to reveal additional options.


  3. Drag-and-drop the Refresh Event onto GetCurrentLicenseInfo.



  4. Repeat steps 1-3 to drag-and-drop the Refresh Event onto GetUserCount also.



  5. With the Auto Refresh Widget still selected, browse the Properties section in the bottom-left.



  6. Change RefreshInterval to 5, and hit your keyboard's Tab key to lock in the change.
    • This will cause the Refresh Event to fire every 5 seconds.



  7. Click Save.
  8. Click View Mashup.




Step 6: Replace License


We have now created a Minimum Viable Product (MVP) of a "licensing dashboard" to ease our administration work.


This dashboard could still be improved. For instance, a Mashup Function could be created which automatically recalculates the value from GetUserCount to more accurately match GetCurrentLicenseInfo. This can be accomplished via the Mashup Builder's bottom-right Functions tab. Or, you could even add a separate Text Field Widget to to the top section and directly access the remaining license time via the LicensingSubsystem > GetDaysRemainingInLicense Service. 


Whatever you choose to do to improve the Mashup is up to you.


However, what should be done when a license is nearing its expiration? To resolve this issue, we need to replace the existing license via the AcquireLicense Service.


  1. Within the OS of the Foundation server, navigate to the file-system folder where the current license_capability_response.bin is located.
    • This is typically the ThingworxPlatform folder.


  2. Move the existing license_capability_response.bin and any other existing *.bin files to another location for backup.
    • Note that this is EXTREMELY important, as if anything goes wrong, you want to be able to restore the original license.
    • It is very important to ensure that only one *.bin file exists in the appropriate folder

  3. Place the new .bin file into the appropriate folder and rename it to license_capability_response.bin.

  4. In Foundation, navigate to the LicensingSubsystem > Services page.



  5. On the AcquireLicense row, click the "play" icon for Execute Service.



  6. On the bottom-right of the pop-up, click Execute.
    • Note that if you receive an error, it will be necessary to restart the ThingWorx Tomcat service.  The act of restarting the service will automatically load the new license.


  7. To close the pop-up, click Done.


After acquiring your new license, you should immediately return to the LicensingSubsystem and consult the GetCurrentLicenseInfo Service to confirm that Thing, User, expiration-date, and other issues are accurate.


If anything goes wrong with the new license transfer, you can simply replace the original license_capability_response.bin file and re-run AcquireLicense to return to your old one. Once again, it is import to perform these steps well before your expiration occurs. 


Foundation checks for a valid license periodically. If this happens while you have an invalid license_capability_response.bin file in-place, you will no longer be able to access the Foundation GUI. 


Fortunately, these issues are self-correcting if a valid license_capability_response.bin is placed in the correct location, as these periodic checks will also pick up a valid license_capability_response.bin file automatically, even after the system has locked you out. 


You should also be able to trigger an AcquireLicense action via a REST call even if the GUI is unavailable. 



Step 7: Next Steps


Congratulations! You've successfully completed the Manage Licensing with Foundation Subsystems guide.


In this guide, you learned how to:


  • Access the Foundation Subsystems
  • Execute built-in Services to retrieve:
    • User counts
    • Thing counts
    • License expiration count
  • Create a "License Dashboard" Mashup
  • Update to a new License 


Additional Resources


If you have questions, issues, or need additional information, refer to:


 Resource       Link
CommunityDeveloper Community Forum
SupportFoundation Help Center


Version history
Last update:
‎Oct 26, 2022 03:02 PM
Updated by:
Labels (1)