Service Trigger

Description

Launches a task when the specified service starts, stops, pauses, resumes or stops responding. You can select a currently running service via the provided drop-down or enter the service name manually. To indicate partial service names, wildcard characters can be used (e.g. * or ?).

Practical Usage

Frequently used to monitor service applications for unexpected crashes. For example, if the specified service suddenly stops, a task can launch and execute a Start Service activity to restart the service as well as run a Send Email action to email a message regarding service stoppage to the appropriate recipient.

Related Topics  

Parameters

General

Property

Type

Description

Wait for service to

Options

Specifies the service action to monitor. The available options are:

  • Stop responding - The task will run when the specified service stops responding, "hangs" or crashes.

  • Start - The task will run when the specified service is started.

  • Stop - The task will run when the specified service is stopped.

  • Resume - The task will run when the specified service is resumed (started again after being paused).

  • Pause - The task will run when the specified service is paused.

  • Installed - The task will run when the specified service is installed.

  • Removed - The task will run when the specified  service is removed.

Service Name

Text

Specifies the name of the service to watch. The provided combination list box accepts manual text entry or the service can be selected from the drop-down list of open services. Wildcard characters * and ? can be used to indicate partial service names. For example, entering e*.exe will watch for all processes starting with the letter e.

Include device and file system drivers

Yes/No

If set to YES, device and file system drivers will be included in the list of services.

Behavior

Property

Description

Trigger on startup if condition is true

If enabled, the system will act upon conditions that already exist upon startup of the current trigger. For example, if the Notepad window is already open on the desktop, a newly created Window trigger set to monitor for the existence of a Notepad window will immediately launch the task as a result. If disabled, the trigger will ignore the open Notepad window upon startup. This parameter is disabled by default.

Trigger after the condition has been met 'X' times.

If enabled, specifies how many times the trigger condition must be met before the task is started. For example, if a Window trigger is set to monitor for the appearance of a Notepad window and this parameter is set to 3, the task will not launch until the third instance of Notepad appears on the desktop.

 

Additional Notes

AMTrigger

When this trigger is activated, it automatically passes the AMTrigger object to the task. AMTrigger is a standard AutoMate dataset and can be used much like the datasets created by the SQL Query and Email actions. The fields of AMTrigger can be used within a task to determine specific values, such as whether or not the task was started by a trigger, which trigger started the task, when the trigger was activated and other properties. AMTrigger populates a unique set of field–value pairs for each AutoMate trigger. The following table lists the ones specific to this trigger. For more details about a specific AMTrigger field–value pair, click the associated link.

Name

Type

Return

AMTrigger.Action

String

Returns the action that took place to cause the task to trigger.

AMTrigger.FileName

String

Returns the full path and filename (also known as Path to executable) of the service that activated the trigger.

AMTrigger.ServiceDisplayName

String

Returns the Service Display Name of the service that activated the trigger.

AMTrigger.ServiceName

String

Returns the Service Name of the service that activated the trigger.

 

NOTE: A full list of AMTrigger objects exclusive to each trigger can be viewed from the Expression Builder by expanding Objects -> Triggers and selecting the desired trigger.