Task variables are visible to all functions within a task. They provide a means of sharing common data between more than one function. Task variables are similar to function parameters in that they are composed of a name, type, and accessibility descriptor. The types supported by task variables are (and must remain) identical to those supported by a task function. Task variables also support optional descriptions. However, unlike function parameters, a task variable cannot be marked as optional. Advantages of Task Variables are:
Preservation of task-centric values - Data that is common to the entire task, and more than one function needs to use its contents, are candidates for elevation to a task variable. An example could be a variable to indicate whether or not the task is being run by particular way, or if the task is in “normal” or “error recovery” mode.
Can be used as a “named constant” - In AWE, a constant is defined at the system level. However, there are situations where a value is meant to be preserved throughout the lifetime of a task, regardless of function or external task, but not dictated by the system configuration. A Task Variable can accomplish this, optionally with the read-only option set.
Provides consistent and predictable access with external tasks - When an external task is called, for example by using the Start Task action, the Task Variables public variables of both tasks are merged together and accessible by both tasks. This allows the creation of, for example, utility tasks that share common data (such as a company name, version number, etc.) See the “External Tasks” section for more details.
Allows information-protection and controls access by external tasks - This can be accomplished by using the accessibility options of a task variable. They control which task variables are merged into a parent task or accessible through a task object.
NOTE: Task variables are different from local variables which are created using the Create Variable action.
Task variables are created and presented in a separate panel located on the Steps pane.
To create a new Task Variable:
In the Steps pane, click the icon to open the Task Functions/Variables table.
This expands the panel where you can set specific parameters.
Click Add. The Task Variable dialog box appears.
Specify the variable name, variable type, access type value, and optional description, then click OK.
Click the new variable icon to collapse the panel.
To edit an existing Task Variable:
In the Steps pane, open the Task Functions/Variables table.
Select the variable you want to edit and click Edit.
Make the desired modifications then click OK when finished. Reflected changed appear in the main panel.
To delete an existing Task Variable:
In the Steps pane, open the Task Functions/Variables table.
Select the variable you want to delete and click Remove.
The following table describes the parameters available during task variable creation/modification.
Property |
Type |
Description |
Variable Name |
Text |
The name of the task variable to create. |
Variable Type |
Text (options) |
The type of task variable to create. The available options are:
|
Access Type |
Text (options |
The task variable's access type. The available options are:
|
Value |
Text |
The value of the task variable. |
Description |
Text |
An optional description of the task variable. |