AMTrigger

When an AutoMate event or condition is used to trigger (i.e. automatically start) a task, a dataset called AMTrigger is created. This dataset can be used within the task to determine specific system states or examine particular characteristics about the object that initially triggered the task. This includes information such as the name of the object that triggered the task, the date and time when the trigger occurred, which machine the trigger occurred and whether that machine was currently in a locked or logged off state when the task executed.

The Behavior tab located in each event or condition's properties determine whether the object will be used as a triggering or non-triggering element during runtime. The parameter labeled Wait for condition along with the option indefinitely are toggled by default allowing the condition to act as a triggering element. Thus, AMTrigger datasets are created and accessible only when the option to wait for a condition indefinitely are selected. When all other Behavior tab parameters are selected, the AMCondition dataset becomes available instead.

For example, the workflow illustrated below contains two File conditions, each set to monitor for a particular file to exist. The File condition located in the beginning of the workflow is used to trigger the launch of the workflow upon the existence of File A. When this occurs, an AMTrigger dataset is properly created and populated. Another File condition is located in the middle of the workflow used to pause execution and wait for File B to exist before proceeding. When this condition is activated, an AMCondition dataset is created and populated with the proper values instead.

AMTrigger is a standard AutoMate dataset and can be used much like the datasets created by the SQL Query and Get E-Mail action. The fields of AMTrigger can be used to examine properties of the event or condition that caused the task to launch. For example, using a 'Message Box' action with the Message to display parameter set to:

%AmTrigger.Trigger%

would display a message dialog during task execution where the message displayed the name of the event or condition that launched the task.

Each AutoMate event or condition contains its own set of unique AMTrigger values. Therefore, the total number of fields that AMTrigger creates during runtime and what they are called depend largely on the object that launched the task. However, every instance of AMTrigger is populated with the following general fields:

Standard AMTrigger Parameters

Each trigger contains its own set of unique AMTrigger values. Therefore, the total number of fields that AMTrigger creates during runtime and what they are named depends largely on the trigger that launched the task. However, every instance of AMTrigger is populated with a list of common AMTrigger fields. They are listed in the table below:

Name

Data Type

Return Value

AMTrigger.Trigger

String

Returns the name of the event or condition that triggered the task. Each event or condition contains a unique name. For example, if the File Condition is used, the value is always AMFILETRIGGER.

AMTrigger.TaskName

String

Returns the name of the managed task that the event/condition was attached to.

AMTrigger.TriggerredDateTime

String

Returns the date and time when the trigger occurred.

AMTrigger.TriggeredOn

String

Returns the machine name where the trigger occurred.

AMTrigger.WasLocked

Boolean

If the workstation was locked when the trigger occurred, the value returned is 1. Otherwise, it will be 0.

AMTrigger.WasLoggedOff

Boolean

If the workstation was logged off when the trigger occurred, the value returned is 1. Otherwise, it will be 0.

AMTrigger.AML

String

Returns a verbose set of information about the triggered event or condition in AML (AutoMate Markup Language) format.

 

NOTE: A full list of AMCondition and AMTrigger objects exclusive to each Event/Condition can be viewed from the Expression Builder by expanding the Objects folder and selecting the desired object from either the Triggers or Conditions folder.

See Also

Using AMCondition

About Conditions

All Available Conditions

Setting Conditions