Automation Center Documentation

Using Variables in a Simple Task

From OpsWise Documentation Wiki

image:pdficon_small.gif 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

  1. From the navigation pane, select Variables and click New.
  2. Give the variable the name Tutorial and a value of Global.
  3. Click Submit.
  4. 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}
    image:tut variable demo global.jpg
  5. Save and launch the Email task.

Resolving Variable Using Value from Task

  1. Open the Email Tutorial Task and click the Variables tab.
  2. Click New and add a variable called Tutorial, with a value of Task, and save it.
  3. Update and launch the task.
  4. Check the email and note that the body of the message now says "Task".

Resolving Variable Using Value from Trigger

  1. Create a new Time trigger with the following values:
    • Trigger Name=Variable Demo
    • Tasks=Email Tutorial
    • Time=a couple minutes from now
  2. Save the Time trigger.
  3. Click the Variables tab and add the Tutorial variable with a value of Trigger.
  4. Enable the trigger.
  5. When the Email task runs, check the email. The body of the email now says Trigger.

image:sb15-1.gif


Return to First Look menu.

For additional information, see:

Personal tools