Process context is all data created, edited, and saved during the execution of a certain process. The data is stored in variables. The content or value of a variable can be changed during the process execution. For example, each time you run a modeled process, it might have different names of contracts and contractors.
Process variables can be local or obtained from an external system (for example, ELMA BPM). The latter can be done at the process start or at the process end.
The list of all context variables is displayed on the process card of the Context tab.
Here you can see a variable’s name, type and scope (In or Out).
On this tab you can add ( ), edit, or delete variables at any stage of a process. To edit or delete, click
and select the option.
начало внимание
When you delete a variable, it is removed from all the activities it is used in. Working with the process might result in errors.
конец внимание
Creating a context variable
To create a new variable, click the button and fill in the required fields.
- Name *. The variable name.
- Variable *. The name of the variable used when working with API, scripts, etc. It is created automatically after filling in the Name* field. You can change it. It is recommended to give a clear name in English, using only letters, numbers, and underscore.
- Description. You can specify the detailed information about the variable and its usage to make it easier to work with the process.
- Scope. All variables have their scope: some may contain initial data for the process start, others may contain the process execution result, and some are intermediate. By restricting the scopes, you can customize the variable visibility for external systems:
- Input. Variables that can be set before the process execution. Their values can be specified when starting a process from ELMA RPA Designer, when creating a task in the Orchestrator, or can be obtained from external systems. They are indicated by the
icon in the variables list. You can set these variables as required. To do that, check the Required box on the form. This scope is used as a default for all created variables;
- Output. Variables passed to external systems after the process ends. They are indicated by the
icon in the variables list.
начало внимание
All context variables, regardless of their scope, can be used and changed during the process execution.
конец внимание
You can set variables as required. To do this, check the Required box on the form.
- String. Can receive values containing letters and numbers ("Hello, world!").
- File. A special ELMA RPA system variable describing a path to the file that can be used when running a process.
- Date/Time. Contains a date ("21.09.2020 09:00").
- Yes/No. A logic variable taking the Yes (True) or No (False) values.
- Non-integer. Can receive values containing numbers with a fractional part ("123,15").
- Integer. Can receive values containing integers ("123").
- Table. Contains a table.
- Structure. Contains a specific set of variables.
- Mail. Contains an email and is used to send and receive emails.
Depending on the selected type of data, you can perform various operations with a variable. For example, in strings, you can change uppercase letters to lowercase (or vice versa), shorten them, or add endings to them. Numbers can be added or subtracted. In logic variables, you can change the Yes/No values, which is very important for creating the process logic.
начало внимание
You cannot change the type of the variable once it is created. If you want to do that, delete the variable and create a new one.
конец внимание
If the variable field is optional, you can select the variable’s type in the Value type field:
- Value. Enter a default value.
- Null. Indicate that the variable has no value.
- Array. Allows you to perform the same sequence of actions for different values of the context variable.
For example, you have to send the same email to several different contractors. You can model a process containing the email address of one contractor. If there are 10 different addresses, you have to run 10 different processes. Using an array, you can set the list of email addresses in one variable. For each address, the bot will perform the same action.
If the Array box is checked, the fields for setting array values appear. To add a new value, click the + Add element link. To delete a value, click .
- Default value. A context variable value set during the process execution in case the value wasn’t set by the user.
Working with the Structure type
When creating a variable of the Structure type, you can specify a set of variables that will be stored in it. For example, you can create a variable Contractor that will store a set of data about a customer. To do this, click the Set button in the Default value field. In the window that opens, you can see a list of available variable types. Drag and drop the types onto the Structure area.
Next, fill in the Name * and Variable * fields. You can set a variable as required or as an array. For example, for a contractor, add the Name, Type of Business Organization, Industry, and Email variables of the String type and the variable Phone of the Integer type. Then, click Save.
Once you have defined a set of variables, you can specify their default values. To do this, in the Create parameter window, click the Enter default value button in the Default value field. In the window that opens, specify the values of all configured variables.
It is possible to specify several sets of values by clicking the + Add value button. You can view them in the same window, going from one page to another. You can delete a set of values by clicking the Delete button.
Found a typo? Highlight the text, press ctrl + enter and notify us