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, wildcards 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.

Parameters

General Properties

Property

Description

Wait for service to

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

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

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

 

Behavior Properties

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.

 

AMTrigger

When this trigger is activated, it automatically passes the "AMTrigger" object to the task. AMTrigger can be used within a task to determine whether or not the task was started by a trigger, which trigger started the task, when the trigger was activated and other trigger related properties. For more details, see Using AMTrigger. The AMTrigger fields described in the table below are specific only to Service triggers.

Name

Type

Return Value

AMTrigger.Action

 

Text (options)

Specifies the type of wait that the trigger used. The available return values are:

  • START: The trigger was set to wait for the service to be started.

  • STOP: The trigger was set to wait for the process to be stopped.

  • HUNG: The trigger was set to wait for the service to stop responding

  • RESUME: The trigger was set to wait for the service to be resumed (started after pause).

  • PAUSE: The trigger was set to wait for the service to be paused.

  • INSTALLED: The trigger was set to wait for the service to be installed.

  • REMOVED: The trigger was set to wait for the service to be removed.

AMTrigger.ServiceName

Text

Returns the short name of the service as shown in the service properties.

AMTrigger.ServiceDisplayName

Text

Returns the display name of the service as shown in the service properties.

AMTrigger.Filename

Text

Returns the path and filename 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.

See Also

↑ Top of Page