AMCondition

AutoMate 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. On the other hand, an AutoMate Condition can affect a task/workflow based on a situation, state or circumstance being met (which normally has a duration), therefore, it can exist as a wait or conditional element in any part of a workflow's path. Each AutoMate Condition contains Behavior properties that determine whether it will be used as a trigger, wait or conditional (or evaluation) element during runtime.

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 File Condition located in the beginning of the workflow triggers the following 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 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 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 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.

 

AMCondition is a standard AutoMate dataset and can be used much like the datasets created by the SQL Query, and Get E-Mail actions. 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 Box' action 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.

Common AMCondition Parameters

Each AutoMate Condition contains its own set of unique AMCondition values. Therefore, the total number of fields that AMConditon creates during runtime and what they are named depend largely on the Condition that was used. However, every instance of AMCondition is populated with a collection of common values which are listed in the table below.

Name

Data Type

Return Value

AMCondition.Agent

String

Returns the name of the agent where the condition activated.

AMCondition.DateTime

String

Returns the date and time of when the condition occurred.

AMCondition.Name

String

Returns the name of the activated condition. Each condition contains a unique name. For example, if the File condition was initiated, the value returned would be. See the help topic for each condition to determine that object's unique name.

AMCondition.Result

String

Returns the result of the activated condition (True or False).

AMCondition.WasLocked

Boolean

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

AMCondition.WasLoggedOff

Boolean

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

AMCondition.AML

String

Returns verbose data about the activated condition in AutoMate Markup Language (AML) format.

 

NOTE: A full list of AMCondition and AMTrigger objects exclusive to each Event/Condition can be viewed from the Expression Builder dialog box by expanding the Objects folder.

See Also


Datasets | AMTrigger | AMTask | AMProcess | AMWorkflow | AMError | Process Agents | Process Object