File Condition

Description

The File condition can trigger a task/workflow based on files being modified, added or removed from a specific folder. It can be set to monitor specific files or all files that reside in a directory as well as size thresholds of files or folders. It can also be used in the middle of a workflow as a "wait" object to wait for one or more files to be added, removed, or modified. It can also determine the path of a workflow depending on whether one or more files exist in a specific directory.

NOTE: File conditions will work on network drives and shares only if the machine is part of a domain and if the computer AutoMate BPA Server 9 is running on has at least Read access to the folder being watched. The condition will not work on mapped drives or network shares that belong to a Win9x workgroup.

Practical Usage

Commonly used to monitor folders for incoming files. When these files arrive, they are automatically processed ("processed" could be any combination of copying, reading, uploading etc).

Parameters

General Properties

Property

Description

Folder

The folder to monitor. Use the Folder button to navigate to the folder to be monitored or manually enter the full path to the desired folder in the field  provided.

Include Subfolders

If enabled, subfolders will be searched within the parent (main) folder being monitored (disabled by default).

Wait for file to be accessible  

If enabled, no action is taken until files are unused and fully accessible (i.e. unlocked). If disabled, action is taken even if files are inaccessible or in a locked state (disabled by default).

Polling interval for remote folders

Determines how often the specified condition should be checked (set to 10 seconds by default).

Prerequisites Properties

Property

Description

File Added

If enabled, the condition will monitor for file(s) to be added to the specified folder (enabled by default).

File Removed

If enabled, the condition will monitor for file(s) to be removed from the specified folder (disabled by default).

File Modified

If enabled, the condition will monitor for file(s) to be modified in the specified folder (disabled by default).

Number of files exceeds

The condition will activate if the number of files in the specified folder exceeds the value entered.

One file size exceeds

The Condition will activate if a file in the specified folder exceeds the value entered (in kilobytes).

Folder size exceeds

The Condition will activate if the total size of the folder being monitored exceeds the amount of kilobytes entered.

 

NOTE: Selecting two or more of the above options will make the condition behave as an OR statement as opposed to an AND statement. In other words, execution starts upon the occurrence of any condition selected. For example, enabling the parameter File Added and entering 1 under the parameter Number of files exceeds will activate the condition when a file is added to the specified folder OR when the number of files in the specified folder exceeds the selected amount.    

Filters Properties

Property

Description

Include Mask

Specifies the filter(s) to be included in the search. Include Masks can be filtered using a full path and filename or filename only. (i.e. C:\Temp\filename.txt or C:\Temp\*.txt or *.txt). In addition, multiple filters can be specified by using a vertical bar or pipe ("|") (i.e. C:\Temp\*.txt|*.jpg).

Exclude Mask

Specifies the filter(s) to be omitted from the search. Exclude Masks can be filtered using a full path and filename or filename only. (i.e. C:\Temp\filename.txt or C:\Temp\*.txt or *.txt). In addition, multiple filters can be specified by using a vertical bar or pipe ("|") (i.e. C:\Temp\*.txt|*.jpg).

File Modified

If enabled, the condition will monitor for file(s) to be modified in the specified folder (disabled by default).

Number of files exceeds

The condition will activate if the number of files in the specified folder exceeds the value entered.

One file size exceeds

The Condition will activate if a file in the specified folder exceeds the value entered (in kilobytes).

Folder size exceeds

The Condition will activate if the total size of the folder being monitored exceeds the amount of kilobytes entered.

Behavior Properties

The Behavior tab properties dictate how the system should react upon the occurrence of a condition. These properties are significant in determining whether the AutoMate Condition should act as a trigger object (used to fire off workflow execution), wait object (used to suspend workflow execution) or conditional (decision making) object.

More about condition behavior

Users Properties

If the File condition is monitoring a folder or file location on a network share or drive, or a location with restricted access rights, a user with rights to that location is required. The following options are available

 

Property

Description

No user required

Specifies that users with proper rights are not required to access the folder being monitored (default).

Use default Agent user

Specifies that the default user entered in the Default Agent Properties of the Agent where the monitored folder resides will be used.

Use this user

Allows a user with proper rights to be entered in the following fields:

  • Default user name - The default user name can be either a plain user name (i.e. sparky), or a username/domain combination (i.e. sparky@networkautomation.com). When the latter form is used, the domain field is disabled.

  • Default password - The password to be used with the default user name specified above. This option can be blank if no password is associated with the selected user.

  • Default domain/machine name - The domain or machine name the user is a member of. This option can be left blank if the user is not a member of a domain or if there is only one workgroup for the machine. These values are also used to replace the special fields of the Logon and Unlock Keystrokes used when logging on or unlocking a workstation.

AMTrigger

When an AutoMate Condition is used to trigger task/workflow execution, a pre-named (or fixed field) dataset called "AMTrigger" is created and populated with a collection of data which is passed onto the associated task. AMTrigger can be used to determine important properties related to the triggered event, such as where (machine name) and when (date/time) the trigger commenced, which AutoMate Event or Condition was responsible for the triggered event and which task started as a result.

Exclusive AMTrigger Parameters

A unique set of AMTrigger values exclusive to each Condition are created and populated along with the collection of common values created by every instance of AMTrigger. The AMTrigger values described in the table below are exclusive only to a File condition.

Name

Type

Return Value

AMTrigger.Filename

Text

Returns the path and filename of the file that was added,modified or deleted (depending on the event settings) .

AMTrigger.Action

 

Text

Returns the action that took place to cause the condition to activate. The value can be one of the following:

  • FILE ADDED

  • FILE DELETED

  • FILE MODIFIED

  • TOO MANY FILES

  • ONE FILE TOO BIG

AMTrigger.Size

Number

If the AMTrigger.Action field returns "ONE FILE TOO BIG", this value is the size (in KB) of the file or folder that activated the trigger.

AMTrigger.NBFiles

Number

If the AMTrigger.Action field returns "TOO MANY FILES", this value is the total number of files in the directory being monitored.

 

AMCondition

When an AutoMate Condition is used as a wait or conditional (decision making) element in the middle of a workflow, it automatically passes a special dataset called "AMCondition" to the connected task. AMCondition can be used to determine important information about the condition that took place.

Exclusive AMCondition Parameters

A unique set of AMCondition values exclusive to each AutoMate Condition are created and populated along with a collection of common values created by every instance of AMCondition. The values described in the table below are exclusive only to a File condition.

Name

Type

Return Value

AMCondition.Filename

Text

Returns the path and filename of the file that was added,modified or deleted (depending on the event settings) .

AMCondition.Action

Text

Returns the action that took place to cause the condition to activate. The value can be one of the following:

  • FILE ADDED

  • FILE DELETED

  • FILE MODIFIED

  • TOO MANY FILES

  • ONE FILE TOO BIG

AMCondition.Size

Number

If the AMTrigger.Action field returns "ONE FILE TOO BIG", this value is the size (in KB) of the file or folder that activated the trigger.

AMCondition.NBFiles

Number

If the AMTrigger.Action field returns "TOO MANY FILES", this value is the total number of files in the directory being monitored.

 

NOTE: A full list of AMTrigger and AMCondition 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


About Events & Conditions | Condition Behavior | Event Log Condition | File Condition | Idle Condition | Key Event | Logon Condition | Performance Condition | Process Condition | SNMP Trap Condition | Window Condition | WMI Condition