Using Variables in a Simple Task
From OpsWise Documentation Wiki
Your trail:TriggersUpgrading OpsWise Automation CenterUser InterfaceUsing ListsUsing Variables in a Simple Task
Open as PDF
In a previous exercise, Launching an Email Task Based on a File Monitor, we included a built-in variable called ${ops_trigger_name} and a system variable called ${_date} to pass information into an Email message. Those variables were resolved using system information when the email task instance was created. In this exercise, we will create a new user-defined variable, use it in a task, and run the task both manually and via a trigger to illustrate how such variables are resolved.
Prerequisite: You need an Email Connection to perform this exercise.
Resolving Variable Using Value from Global Variable Table
- From the navigation pane, select Variables and click New.
- Give the variable the name Tutorial and a value of Global.
- Click Submit.
- Create a new Email task with the following values:
- Task Name=Email Tutorial
- Email Connection=your email connection
- To=your email address
- Subject=Variable demo
- Body=${Tutorial}
- Save and launch the Email task.
Resolving Variable Using Value from Task
- Open the Email Tutorial Task and click the Variables tab.
- Click New and add a variable called Tutorial, with a value of Task, and save it.
- Update and launch the task.
- Check the email and note that the body of the message now says "Task".
Resolving Variable Using Value from Trigger
- Create a new Time trigger with the following values:
- Trigger Name=Variable Demo
- Tasks=Email Tutorial
- Time=a couple minutes from now
- Save the Time trigger.
- Click the Variables tab and add the Tutorial variable with a value of Trigger.
- Enable the trigger.
- When the Email task runs, check the email. The body of the email now says Trigger.
For additional information, see:
