I’m currently migrating several solutions from Pega Robotics Studio 19 to R25 and have some questions about the new Globals approach.
In Studio 19, every solution had its own Global Containers. In R25, however, each project contains a single Globals item by default, so global variables have effectively moved from solution level to project level.
I’m wondering what the recommended best practices are for this new architecture.
1. Reusing adapter solutions across multiple projects
In Studio 19, I could easily reuse an adapter solution in multiple projects because each solution had its own Global Container.
In R25, the global variables are created at the project level. If I copy or move an adapter solution from Project A to Project B, the required Globals are no longer present.
What is the recommended way to build reusable adapter solutions in R25?
2. Resetting all Globals
In Studio 19, I used the ResetState method on the Global Container to clear all global variables at once.
When I try the same approach in R25 and perform the ResetState method on the Global container folder, I receive the following error:
“No component is associated with this connection block.”
Has the recommended way of resetting global variables changed?
Is there now a supported way to clear or reset all variables in the Globals project item, or is the expectation that every variable must be reset individually?
I’d appreciate any guidance or best practices from anyone who has already migrated to R25.
To re-use application projects in multiple projects in v22 and R25, you would use Assets. Here is a link to the documentation Working with Assets.
There are 3 types of Assets available:
Application (contains a single Application - self contained logic)
Utility (used for sharing utility automations not tied to an application)
Project (used for sharing a sub-project)
Our recommendation is when creating from scratch a new Application do this using an Application Asset. However, when moving from v19 to R25, the smoothest transition will be to convert your sub-projects to Project Assets . Here is the documentation on this Strategies for converting 19.1 projects into Project Assets. If you follow this guidance before upgrading your 19.1 projects, the Upgrade Assistant will identify Project Assets that match the ID of your 19.1 sub-projects and replace them with Assets. So, there is prep work required before you start upgrading …
Here is a workflow you can follow when upgrading:
Identify the the projects in your 19.1 solution that will be reused - these will become Project Assets.
Create a new solution for each candidate project in v19 - 1 project per solution.
Convert each solution to R25 as a standalone project - each of these projects will be where you will edit the Project Asset going forward.
Deploy each new R25 project to Robot Manager as a Project Asset - do not deploy these as Projects.
When you have all of your Project Assets ready, you then convert your base v19 solution to R25. Check the Use assets if available option.
Each Project Asset will have its own Globals and the resulting project will look and feel very similar to your v19 solution. If you need to make changes to any of your Assets, those changes would be done in the master project you created in Step 3. After making changes deploy the new asset version to Robot Manager and then you can update the asset in any project which requires the update.
In v22 and R25 there is no longer an option to reset all Globals in a project. I will add this to our enhancement request list.
We made significant changes to Globals when moving away from v19. Having all Globals in a single container makes it much easier to maintain. Folders were added to the container to allow for better organization.
Thank you for your detailed response. We really appreciate you taking the time to explain the recommended migration approach.
I have a few additional questions:
If we decide to migrate our projects as-is without taking Assets into account, my understanding is that it will no longer be easy to replace an adapter solution with a newer version.
During the migration, a Globals.pGlobals file is created. This file contains new references to the Global containers and global variables for each solution. These references receive new, unique IDs, which are different for every migrated project.
As a result, if we were to overwrite the solution folder with a newer version of the solution, the references to these Globals would no longer work.
My question is: if we initially migrate everything as-is, is it still possible to replace an existing adapter project with a Project Asset at a later stage? If so, would this require manually replacing the automation blocks and Global variables?
In step 3, you mention upgrading the individual projects to R25.
Are there any additional actions we should perform within those projects? For example, should we move the existing Globals to Asset Globals, or can everything remain as-is?
I’m also curious about how step 5 works.
If we migrate one of our use-case solutions and enable “Use assets if available”, does the Upgrade Assistant check the Project ID of the Assets deployed to Robot Manager to determine which Asset should replace each project?
If the migration works this way, will the references to the automations and Globals continue to work automatically after the replacement?
That would be greatly appreciated. Having a ResetState option for the Globals container would allow us to reset all Global variables in a single step, instead of having to build and maintain a separate automation that manually resets each variable.
Apologies for the delayed response! Let me address your questions one at a time:
Migrating projects without accounting for assets upfront can make it quite tedious to add a Project Asset later. The effort involved depends largely on how tightly coupled your main project and sub-project are. If your main project only calls automations in the sub-project, replacing those touch points should be straightforward. However, if the main project interacts directly with controls or components in the sub-project, that solution is likely not a good candidate for Project Assets.
There are some subtle but important differences between how global items work in v19 versus Project Assets. In v19, you could use a global item from a sub-project directly in your main project - this is not possible with Project Assets, which only expose their automations and applications to the main project. That said, if you are creating a new Project Asset, there is no need to modify your global containers manually; the upgrade process will consolidate all global containers in your project into a single container automatically.
When you select “Use assets if available” during the upgrade, the upgrade assistant locates the asset in Robot Manager by Id and pulls it into the project. All references will work with no further changes required.
In summary, the level of isolation between your sub-projects will be the key factor in determining how easily you can adopt Project Assets.
One more thing - the ResetState for Globals feature is planned for an upcoming release later this year. Thank you for flagging that gap; that kind of feedback is exactly what helps us prioritize!