Automation Center Documentation

Launching an Email Task Based on a Task Monitor

From OpsWise Documentation Wiki

image:pdficon_small.gif Open as PDF

In this exercise, we will set up a Task Monitor and Task Monitor trigger. The Task Monitor will monitor all tasks for a status that indicates some sort of problem. When the trigger is satisfied, the system will launch an Email task that notifies a user that there is a problem. We will also create an Email template for use in our Email task and create an Activity screen filter that displays only problem tasks.

The following illustration shows the various components used to trigger tasks based on the status of other tasks.

image:task monitor diagram.gif

Contents

Creating an Activity Screen Filter

The first task we will do is create a filter for the Activity screen that will be used by our imaginary tech support person. When this user receives an email indicating there is a problem, he or she can view this Activity screen to find out more information. In OpsWise Automation Center, this filter is referred to as a report. For more detailed explanations of each field, see Reports.

  1. From the Navigation pane, select Automation Center > Reports. The main report screen displays.
    image:tut_reports list.gif
    This screen provides a list of all reports that your userid has access to, along with a New button that allows you to create a new report.
  2. Under My Saved reports, click New. A blank reports screen displays.
  3. image:tut_blank reports screen.gif

  4. In the Name field, enter "Problem Task Instances".
  5. In the Visible to field, select Everyone.
  6. In the Type field, select List.
  7. In the Table field, select Activity[ops_exec], which is the table used for all Activity reports and contains information about all task activity.
  8. Skip the Group by field.
  9. In the Filter and Order fields, click the plus (+) sign and select the following:
    1. In --choose field -- select, Status
    2. In the operator field, select is one of.
    3. In the last field, use CTRL+Click to select all of: Undeliverable, Running/Problems, In Doubt, Start Failure, Cancelled, Failed.
  10. The Columns section displays a list of available fields in the Available section, and the selected fields in the Selected section. A number of default fields appear in the Selected section. For this tutorial, move the following fields to the Selected list in the order shown:
    • Status
    • Type
    • Instance Name
    • Invoked By
    • Start Time
    • End Time
    Hint: To select and deselect fields:
    • On the Selected list, double click fields to remove them from the report.
    • On the Available list, double click fields to add them to the report.
  11. To save the report, click Save.

image:tut report.gif

Now we will open a new tab containing only our new Activity screen:

  1. Open a new browser tab.
  2. From the first tab, click and drag the Activity option to the new tab.
  3. Click the new tab. Note that the new tab contains only the Activity screen, without the navigation pane and other application options.
  4. image:tut activity in new tab.jpg

  5. Click the scroll bar at the top that shows the current report name.
  6. image:tut activity reports.gif

  7. Select the report you just created, Problem Task Instances. Your Activity screen will now show only problem task instances, sorted by status (the leftmost column).
  8. image:tut activity problems.gif

Creating an Email Template

Email Templates allow you to create a "canned" Email task that you can then refer to when creating an Email task. This is useful if you have a large number of common parameters on Email tasks but still require separate tasks.

  1. From the navigation pane, select Resources > Email Templates.
  2. For Template Name, type Notification based on status.
  3. For Email Connection, select the connection you defined for earlier exercises.
  4. For the To field, enter a usable email account that you can use for the tutorial.
  5. For Subject, type:
  6. Task failure alert
    
  7. For Body, enter
  8. Task failure, see Problem Report Activity screen
    
  9. Click Submit. Your Email Template should resemble the sample shown below.
  10. image:tut email template

Creating an Email Task Using an Email Template

  1. From the navigation pane, select Tasks > Email Tasks and click New.
  2. In the Task Name field, type Triggered by Task Status.
  3. In the Email Template field, select the Email Template you just created, Notification based on status. For our purposes, we will leave the remaining fields blank since we want to use the information from the template. If you fill in any of the duplicate fields, the information from the task overrides the information from the template.
  4. Click Submit.

Creating the Task Monitor Task

For this Task Monitor, we will monitor the status of all other tasks. If any task has a status that indicates there is some sort of problem, we will generate an email. Once the Task Monitor is launched by the Task Monitor trigger, it remains active, launching an email every time any of its conditions are met. The Task Monitor task remains active until the Task Monitor trigger is disabled or until a user manually stops it.

  1. From the navigation pane, select Tasks > Task Monitors, and click New.
  2. In the Task Name field, type Monitors for Problems.
  3. In the Status area, enable the following statuses: Undeliverable, Running/Problems, In Doubt, Start Failure, Cancelled, Failed. Hint: For a description of each status, see Task Status Descriptions.
  4. In Monitoring Type, select General Tasks. Note that you can also select Specific Task and browse for a task name.
  5. In Task type to Monitor, we will leave all task types selected for our exercise.
  6. Click Submit.
  7. image:tut task monitor.jpg

Creating the Task Monitor Trigger

As the last step in our setup process, we will create the Task Monitor trigger, which controls when the Task Monitor task is started and stopped.

  1. From the navigation pane, select Triggers > Task Monitor Triggers and click New.
  2. In Trigger Name, type Controls Monitors for Problems.
  3. In the Task Monitor field, browse to the Task Monitor task you just created (Monitors for Problems).
  4. In the Tasks field, click on the lock icon and type a T in the browse field. This will jump to a list of tasks whose names begin with "T". Hint: Click here for more information about selecting records.
  5. image:tut string search.jpg

  6. Select Triggered by Task Status, which you created earlier.
  7. Click the down-arrow and select Save.
  8. Click Enable Trigger.
  9. image:task monitor trigger.jpg

Running the Task Monitor

To test our setup, we need to run a task to one of the failure statuses that will trigger the email. To do so, we will launch the Manual task we created earlier and force it into Failed status.

  1. From the navigation pane, select Tasks > Manual Tasks.
  2. Right-click on the Pause for Manual task and select Launch Task.
  3. Display the Activity screen with the Today's Task Instances by Created Times filter.
  4. First note that the Monitor for Problems task is running. It was launched when you enabled the trigger.
  5. image:tut running task monitor.jpg

  6. Locate the Pause for Manual task instance, which will be in Action Required status.
  7. Right-click on Pause for Manual. This displays a list of commands that are currently available for this task instance.
  8. image:tut command menu.gif

  9. Select Cancel. Pause for Manual goes to Cancelled status and an Email task is launched by the Task Monitor trigger.
  10. Check the email account where you sent the notification.
  11. image:tut failure notification

  12. Once the user receives the email, he or she can quickly check for more information by looking at the Activity screen using the Problem Task Instances filter and clicking on the Instance Name of the problem task. As shown in the illustration below, additional information about the issue is displayed in the Status Description field.
  13. image:tut status description.jpg

    Hint: To view the status description and other information about a workflow instance, use Task Instances > All Task Instances.


image:sb15-1.gif


Return to First Look menu.

For additional information, see:

Personal tools