AMCondition

Description

Events and Conditions are similar in that they are objects that 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. On the other hand, a condition can affect a workflow based on a situation, state or circumstance being met (which normally has a duration), therefore, AutoMate conditions can exist at any point in a workflow's path as a wait or conditional element. Each AutoMate condition contains Behavior properties that determine whether it will be used as a trigger, wait or conditional object.

When an AutoMate condition is used as a trigger object in the beginning of a workflow, a pre-named (or fixed field) dataset called AMTrigger is created and populated with a collection of data related to the triggered event. When it is used in the middle of a workflow as wait or conditional object, a dataset called AMCondition is created instead. AMCondition can be used in a subsequent task to determine specific system states or examine particular characteristics about the condition that was used as a wait or conditional element, such as the name of the Condition, the machine name where the wait or conditional operation occurred and whether that machine was currently in a locked or logged off state when the operation occurred.

For example, the workflow illustrated below contains three File Condition objects, each used to monitor the existence of a particular file. The first File condition (in the beginning of the workflow) triggers the succeeding task upon the existence of File A. 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 as a wait element which suspends workflow execution until the existence of File B. When File B is detected, an AMCondition dataset is created and passed onto the next task. The third File condition is used as a conditional element and evaluates whether or not File C exists. If the condition is TRUE, it will execute the task following a Success Arrow. If the condition is FALSE, the task following a Failure arrow is executed 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

Using AMCondition

AMCondition is a standard AutoMate dataset and can be used much like the datasets created by the SQL Query, and Get E-Mail activities. The fields of AMCondition can be used to examine characteristics of the condition that initiated during the course of a workflow. For example, using a Message dialog activity with the Message to display parameter set to:

%AMCondition.Agent%

would display a message dialog during runtime that shows the name of the agent that the task was executed on.

The AMCondition dataset elements that are created when a non-triggering AutoMate condition occurs are comparable to the AMTrigger dataset elements created. The only difference is the syntax. For example, to return the filename that caused a 'File' condition to start a task, the dataset AMTrigger.FileName is used. When the same 'File' condition is used in the middle of a workflow, AMCondition.Filename is used.

Global AMCondition Values

Every instance of AMCondition is populated with a collection of "global" values which are common to all conditions. These values are populated every time a condition is implemented in a workflow.

For more details, see AMCondition - Global Values