Using Variables in a Workflow
From OpsWise Documentation Wiki
Your trail:Upgrading OpsWise Automation CenterUser InterfaceUsing ListsUsing Variables in a Simple TaskUsing Variables in a Workflow
Open as PDF
For tasks executing within a workflow, the order of precedence for resolving user-defined variables differs. As the following exercise demonstrates, the variable definition in the task takes precedence, then the system looks within the workflow or parent workflow(s), with the global variable coming last.
Prerequisite: You need a working database connection to do this exercise.
- Create a SQL task called SQL With Variable with the following SQL command.
- Within the task, define a variable called tutorial, with a value of task.
- Submit the SQL task.
- Create a new workflow called Variable Workflow.
- Add the SQL With Variable task and save the workflow.
- Launch the workflow and open the SQL With Variable task instance on the Activity screen. Note that the SQL command resembles the following, with the value from the task variable.
- Open the task and delete the task variable.
- Go back to Variable Workflow and add the following variable:
- Open the task instance. The SQL command used the variable from the workflow because the task no longer had a variable.
CREATE TABLE ${tutorial}${_date("yyyyMMdd",5)} (name varchar(128), value varchar(128));
CREATE TABLE task20090913 (name varchar(128), value varchar(128));
tutorial/workflow
CREATE TABLE workflow20090913 (name varchar(128), value varchar(128));
For additional information, see:
