Service Condition

See Also

Setting a Service Condition, About Conditions, All Available Conditions, Using AMTrigger, Using AMCondition

Description

Launches task when the specified service starts, stops, pauses, resumes or stops responding. To indicate partial service names, use wildcard characters * and ?.

Practical Usage

Frequently used to monitor service applications for unexpected crashes.

Parameters

General Tab

Wait for service to

Specifies the time based interval on which the schedule will be based. If the task should run every day, select days, the task should run monthly - select months.

The available options are:

Service Name

Specifies the name of the service to watch. A drop down populated with currently running services is supplied for convenience. The wildcard characters * and ? may be used, for example e*.exe would watch for all processes starting with the letter e.

Behavior

All available Conditions contain Behavior properties that dictate how it should handle a monitored event or condition. These properties determine whether the Condition should act as a trigger, a wait object or conditional (or decision making) object. By default, new Conditions are set to wait for the specified event/condition indefinitely, allowing it to act as a trigger object. For more details, see Condition Behavior.

AMTrigger Parameters

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.

Common AMTrigger Fields

Every instance of AMTrigger populates a list of common fields which are described in the table below.

Name

Data Type

Return Value

AMTrigger.Trigger

String

Returns the name of the event or condition that triggered the task. Each event or condition contains a unique name. For this trigger, the value is always AMSERVICETRIGGER.

AMTrigger.TaskName

String

Returns the name of the managed task that the trigger was attached to. Useful to determine the responsible task when two managed tasks point to the same AML file.

AMTrigger.TriggerredDateTime

String

Returns the date and time when the trigger occurred.

AMTrigger.TriggeredOn

String

Returns the machine name where the trigger occurred.

AMTrigger.WasLocked

Boolean

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

AMTrigger.WasLoggedOff

Boolean

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

AMTrigger.AML

String

Returns a verbose set of information about the triggered event or condition in AML (AutoMate Markup Language) format.

 

Specific AMTrigger Fields

The AMTrigger fields described in the table below are specific only to Service triggers.

Name

Data Type

Return Value

AMTrigger.Action

 

Text

Specifies the type of wait that the trigger used. The available returns 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 being watched.

 

AMCondition Parameters

Each Event or Condition contains its own set of unique AMCondition values. Therefore, the total number of fields that AMConditon creates during runtime and what they are called depend largely on the condition that was activated. However, every instance of AMCondition is populated with the following general fields:

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.

 

Specific AMCondition Fields

The AMCondition fields described in the table below are specific only to the Service Condition.

Name

Data Type

Return Value

AMCondition.Action

 

Text

Specifies the type of wait that the trigger used. The available returns 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.

AMCondition.ServiceName

Text

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

AMCondition.ServiceDisplayName

Text

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

AMCondition.Filename

Text

Returns the path and filename of the service being watched.

 

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

About Events & Conditions

All Available Events & Conditions

Condition_Behavior