Share Values Between RPA Processes with Global Variables
Learning Objectives
After completing this unit, you’ll be able to:
- Describe global variables.
- Create global variables.
- Manage global variables.
- Understand global variables scope.
Before You Start
This module builds on MuleSoft RPA Process Testing, so we recommend that you complete it before you continue. In that module, you learn how to test an RPA process to ensure it performs as expected when deployed to production.
In this module, we assume your organization has purchased a MuleSoft RPA license. If you don’t have a license, that’s OK. You can still read along to learn how to perform the steps. Don’t try to follow the steps in a Trailhead Playground, because MuleSoft RPA isn’t available in the Trailhead Playground.
In this unit, you learn how to work with global variables. You need to first understand global variables before you move on to deploying RPA processes later in this module.
What Are Global Variables?
Recall that when you test RPA processes, you set activity parameter values in the deployment configuration. But what if these values should be the same for every deployment? That is where global variables come in. Global variables give you a way to define reusable values to share among RPA process deployments. These reusable values can even be used for different RPA processes, which saves you time and provides standardization.
Let’s take a look at an example of how a company might use global variables in a real-world scenario. ACME uses MuleSoft RPA to automate its processes for order management, invoice processing, finance, and master data management. Many RPA processes that have been built for ACME read files from a file share hosted externally. The absolute path must change weekly due to security concerns.
This file share path is defined as an activity parameter in all processes, but not necessarily with the same name. For example, the order management process uses an activity parameter named “fileShare” and the invoice processing process uses an activity parameter named “filePath.” The value for both fileShare and filePath is the same external path that changes weekly. To save time and standardize the process, ACME can use global variables to share values.
Create Global Variables
In MuleSoft RPA Manager, the Global Variables menu under the Process Automation module is used for viewing, creating, and managing global variables.
When creating global variables, you must provide a name, description, type, and value. You must also specify the phase where the global variable is used, which can be Test or Production phases.
View and Manage Global Variables
The Global Variables menu shows all available variables in a table. The following three actions are available for global variables.
Action Icon |
Description |
---|---|
Usage |
Shows all configurations where the global variable is used. |
Edit |
Edits the global variable. All fields can be edited even while the process is in the middle of execution. The new value becomes available during the next process run. |
Delete |
Deletes the global variable. Only global variables that aren’t in use can be deleted. |
Changes made to a global variable value during an RPA process execution affect that process only. The change doesn’t propagate to MuleSoft RPA Manager. This behavior ensures that changes in one process don’t adversely affect other RPA processes.
Define Global Variable Data Types
MuleSoft RPA Manager allows developers to define five types of global variables.
Global Variable Type |
Description |
Allowed Values |
---|---|---|
Integer |
Integer values |
Range: -2147483647 to 214748647 |
Alphanumeric |
Any character string |
No length restriction |
Boolean |
Logical value |
True or false |
Float |
Floating point number |
16 digit precision after decimal |
Coordinates |
Combination of two integer values for an X-Y coordinate |
Range: -2147483647 to 214748647 |
Walkthrough
Take a look at these walkthrough instructions to guide you through the steps to create and work with global variables.
In this unit, you learned how to create and manage global variables in MuleSoft RPA Manager. You also reviewed the available data types for global variables, their range, and their scope. In the next unit, you learn how to deploy an RPA process to production on a MuleSoft RPA bot.