Variables in control flows
A variable is a user-defined name that represents data that can be changed within an activity property in a data flow or control flow. By setting variables for certain resources, you can defer the definition of critical properties until a later phase in the life cycle of the warehousing application.
In the Design Studio, you specify the change phase for variables during flow design and application packaging. The change phase defines the last stage in the life cycle when the value for the variable can be set: design time, deployment preparation, deployment, run time, or instance. You can modify the default value for a variable in the Administration Console if the change phase is deployment, run time, or instance.
Variables and their values are always managed on the application level and shared by all control flows and control flow instances. In the Administration Console, you can use variables to specify properties of certain operators in a control flow or data flow. Variables can also be used to contain the result of an operator so that the result can be passed to other operators.
Default variable values
If you use the Application Details window to change the default value of a variable, the new value will be the default for all subsequent runs of the control flow for that warehousing application. If a variable value changes, the change affects all control flows that contain the variable and their instances. To specify a different value for a variable for a control flow instance, you must use the Run button on the Manage Control Flows window. Changes to variable values for an instance must be specified every time the instance runs.
For example, if you change the default value of a variable named myvar1 from c:\test to c:\test\out, then every occurrence of myvar1 in every control flow in the application will have c:\test\out as its new default value. When a control flow instance runs, it uses the value that is set when the instance starts. This selection has no impact on another instance. If no value is set, it uses the default value.
Variables for activity attributes
Variables for activity attribute values are treated as activity-specific runtime variables; therefore, a change to a variable value is applied to each subsequently started instance. If an activity attribute value is potentially different for each instance, the attribute value must point to an application variable.
For example, the e-mail operator has four properties: sender, recipient, subject, and message. If you define the sender and recipient as deployment phase variables, they cannot be adjusted at run time. If you set the subject and message properties as fixed values during design time, those fixed values can be changed in the Value field on the Manage Control Flows page using the Run button in the console.