Specifying the variable element and its attributes

A workflow variable is defined on the variable (<variable>) element.

The elements and attributes that are used to define variables are listed in Table 12 and Table 13.
The following attributes are supported for the variable (<variable>) element:
name
Name of the variable. The variable name is required, and must be a string that consists of letters (uppercase or lowercase), numeric digits, the hyphen, and the underscore character. The variable name must begin with a letter.

The combination of variable name and variable scope must be unique within the workflow.

When you are choosing a variable name, be aware that the following string values are reserved; they cannot be used as the variable name:
  • workflowKey
  • metaAppVersion
  • releaseVersion
  • String value that ends with --lastSetStep
  • String value that ends with --lastSetTime.
scope
Scope of the variable, as follows:
instance
Variable is used only within the workflow in which it is defined. If multiple workflows are created from the same workflow definition file, each has its own set of instance scoped variables.
global
Variable can be referenced by any workflow that is imported into the Workflows task. Global variables are shared across all workflows, even workflows that are created from different workflow definitions. As an example, you might use a global variable to refer to a product-specific constant across a number of workflows that are associated with the product.

The scope is required. The default is instance.

The combination of name and scope must be unique within the workflow.

You cannot use the same name for both an instance variable and a global variable in the same workflow definition.

Use global variables with caution to avoid possible naming conflicts across unrelated workflows. Consider your naming conventions carefully and avoid using unspecific variable names. Similarly, consider qualifying your variables, for example, with the 3-character prefix associated with your software product, or a unique identifier.

Be aware that variables are case-sensitive. For example, "Variable1" is not the same as "variable1."

Notes:
  • Global variables are deprecated, as of z/OS V2R3. IBM recommends that you use instance variables or system variables, instead. Global variables might not be supported in a future release. For information about creating system variables, see z/OSMF system variable services.
  • z/OSMF includes a number of "built-in" workflow variables, which might provide the function that you require; see Workflow internal variables.
visibility
Specifies whether the variable is intended for public or private use. This attribute is intended for the workflow author’s use. The visibility setting does not affect how the variable is processed by the Workflows task. This attribute is optional; the default is private.

Example of a variable definition

In the example in Figure 1, the variable variable_test is defined.
Figure 1. Specifying attributes on the variable element
<variable name="variable_test" scope="instance" visibility="private">
        <label>Variable 4</label>
        <abstract>Abstract for Variable 4.</abstract>   
        <description>Description for Variable 4.</description>   
        <category>variables</category>
        <string/>
    </variable>