AMTrigger - Overview

Description

When a task is triggered, it automatically creates a dataset called AMTrigger. This dataset can be used within a subsequent task to examine system states or determine particular characteristics about the type of event or condition that initially triggered task execution, such as the name of the object that triggered the task, the date and time when the trigger occurred, which workstation the trigger occurred on and much more.

AMTrigger is a standard Automate dataset and can be used much like the datasets created by the Database - SQL query and Email - Get activities. The fields of AMTrigger can be used to examine properties of the trigger that caused the task to launch, such as the type of event that activated the trigger, when it occurred, which workstation it occurred on and much more. For example, using a Message Box activity with the Message to display parameter set to %AmTrigger.Trigger% would display a message dialog during task execution that displayed the name of the trigger that launched the task.

Accessing AMTrigger

A full library of pre-defined Automate AMTrigger values can be found in the Expression Builder by navigating to Objects > Triggers (shown below). The AMTrigger folder contains all global AMTrigger values and any sub-folder underneath this folder (represented by the trigger name) contains the AMTrigger values unique to each trigger. To access help regarding a specific AMTrigger field, select the folder that contains the AMTrigger object in question. Doing so populates the right panel with available AMTrigger objects. Select the object from this panel and press F1 or simply right-click and select Help from the drop-down list menu that appears.

In addition, you can access AMTrigger information during task development and testing phase by way of the Task Builder's Variables Debug Panel. Variables Debug Panel

Global AMTrigger Fields

Every instance of AMTrigger is populated with a list of "global" AMTrigger fields which return general information which are common to all available triggers. This allows you to retrieve prevalent information about the trigger responsible for firing off task execution, including the name of the trigger that fired, the name of the task that ran as a result, the date and time when the triggered event occurred, which computer it occurred on, and much more. The global list of AMTrigger fields are listed in the table below. For more details about a specific field, click the associated link.

Name Data Type Return Value
AMTrigger.AML String Returns a verbose set of information about the triggered event in AML (Automate Markup Language) format.
AMTrigger.Trigger String Returns the unique name of the trigger that was used, this value is always AMFILETRIGGER.
AMTrigger.TaskName String Returns the name of the managed task that the trigger was attached to. Useful to determine the responsible task when two managed tasks point to the sae of the trigger that caused the task to start. Each trigger has its own "unique name" (listed below). For example, if the File System trigger me AML file.
AMTrigger.TriggerredDateTime String Returns the date and time when the triggered event occurred.
AMTrigger.TriggeredOn String Returns the computer name or IP address of the computer where the triggered event occurred.
AMTrigger.WasLocked Boolean Returns the locked state of the computer at the time the triggered event occurred. If the computer was locked during the triggered event, the value returned is 1. Otherwise, it will return 0.
AMTrigger.WasLoggedOff Boolean Returns the the logon state of the computer at the time the triggered event occurred. If the computer was logged off when the trigger occurred, the value returned is 1. Otherwise, it will be 0.

AMTrigger Fields Exclusive to Each Trigger

Along with the list global AMTrigger fields that are shared among all triggers, there are AMTrigger fields unique to each individual trigger. Because of this, the total number of AMTrigger fields that Automate creates during runtime and what they are named depends largely on the trigger that launched the task. Use the links contained in the following table to navigate to the appropriate topics containing the list of AMTrigger fields unique to each trigger.

Name Description
AMTrigger - Database Unique AMTrigger fields associated to the Database trigger.
AMTrigger - Event Log Unique AMTrigger fields associated to the Event Log trigger.
AMTrigger - File System Unique AMTrigger fields associated to the File System trigger.
AMTrigger - Idle Unique AMTrigger fields associated to the Idle trigger.
AMTrigger - Key Unique AMTrigger fields associated to the Key trigger.
AMTrigger - Logon Unique AMTrigger fields associated to the Logon trigger.
AMTrigger - Performance Unique AMTrigger fields associated to the Performance trigger.
AMTrigger - Process Unique AMTrigger fields associated to the Process trigger.
AMTrigger - Schedule Unique AMTrigger fields associated to the Schedule trigger.
AMTrigger - Service Unique AMTrigger fields associated to the Service trigger.
AMTrigger - SharePoint Unique AMTrigger fields associated to the SharePoint trigger.
AMTrigger - SNMP Trap Unique AMTrigger fields associated to the SNMP Trap trigger.
AMTrigger - Window Unique AMTrigger fields associated to the Window trigger.
AMTrigger - WMI Unique AMTrigger fields associated to the WMI trigger.
NOTE: A full list of AMTrigger objects exclusive to each trigger can be viewed from the Expression Builder by expanding Objects > Triggers and selecting the folder associated to the desired trigger.