AMTrigger

Description

Events and Conditions are similar in that they can be placed in the beginning of a workflow in order to automatically trigger its execution. However, because events are typically defined as one time occurrences, an AutoMate event is limited only as a "triggering" object, whereas, an AutoMate Condition can affect a workflow based on a situation, state or circumstance being met (which normally has a duration), therefore, they can exist as wait or  conditional elements in any section of a workflow.

Each AutoMate condition contains Behavior properties that determine whether it will operate as a triggering or non-triggering element during runtime. When used as a trigger, a pre-named (or fixed field)  dataset called AMTrigger is generated and populated with a collection of data related to the triggered event. This dataset can be used within a task to determine specific system states or examine particular characteristics about the object that initially triggered execution. This includes information such as the name of the object used as a trigger, the date and time when the trigger occurred, the machine name where the trigger commenced and whether that machine was currently in a locked or logged off state when the trigger occurred. In addition, Behavior parameters can be modified to make the Condition behave as a non-triggering element. In such cases, the AMCondition dataset becomes available instead.

For example, the workflow illustrated below contains three File Condition objects, each used to monitor the existence of a particular file. The File Condition located in the beginning of the workflow waits indefinitely for File A to exist and triggers the connected task upon its existence. When this happens, an AMTrigger dataset populated with a collection of information about the triggered event is created and passed onto the following task. The second File Condition is used to pause execution and wait for File B to exist. When the file is detected, an AMCondition dataset is created and passed onto the next task. The third File Condition is used to immediately evaluate whether or not File C exists. If the evaluation is TRUE, it will execute the task following a Success Arrow. If the evaluation is FALSE, the task following a Failure Arrow runs instead. In both situations, an AMCondition dataset populated with information about the evaluation that took place is created and passed along to the appropriate task.

Related Topics

AMTrigger is a standard AutoMate dataset and can be used much like the datasets created by the SQL Query and E-Mail actions. The fields of AMTrigger can be used to determine properties of the object that caused the task to launch. For example, using a Message Box activity with the Message to display parameter set to:

%AmTrigger.Trigger%

would display a message box during task execution that  displays the name of the AutoMate Condition that triggered the task.

Global AMTrigger Values

Every instance of AMTrigger is populated with a collection of "global" values which are common to all events and conditions. These values are populated every time a trigger is responsible for firing off workflow execution. For more details, see AMTrigger - Global Values.