Enable/Disable Task

Declaration

<AMENABLETASK MANAGEDTASK="text" MANAGEDTASKID="text" />

See Also

Call Function | Stop Task | Write to Log | Enable/Disable Task | Shut Down AutoMate | Start Task | Trigger Task | Backup AutoMate

Description

Enables a currently disabled managed task or disables a currently enabled managed task. If the specified task is already set to the proper value, this parameter is ignored and the current task continues execution with no errors.

Practical Usage

Often used to cause other task(s) not to execute while the current task is executing. To accomplish this, a Disable Task step could be placed at the beginning the task and an Enable Task step could be placed at the end.

Parameters

General Properties

Property

Type

Required

Default

Markup

Description

Action

Text (options)

Yes

Yes

ENABLE="NO"

Specifies the action to execute. The available options are:

  • Enable (Default) - Enable a managed task.

  • Disable - Disable a managed task.

Managed Task

Text

Yes

(Empty)

  1. MANAGEDTASK="Task1"

  2. MANAGEDTASK="Foldername\Task1"

Specifies the name of the managed task. Click the down arrow and select the desired task from the list that appears.

NOTE: The task must exist in the current machine task list at runtime or the step will fail. Also, changing the task name or parent folder name later can break this linkage once created.

Password to use if the task is protected from being modified

Text

No

(Empty)

PASSWORD="mypassword"

Enabling or disabling a managed task is deemed as modification of its properties. Therefore, if the task that you wish to enable/disable had been previously password protected from allowing its properties to be modified (as specified in the managed task's Security properties), this parameter indicates the password to permit modifications to the task.

↑ Top of Page 

Description Properties

The Description tab allows you to customize the text description of any step when it appears in the Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab is part of AutoMate's Error Handling functionality which allows you to select / omit specific errors that will cause a particular step to fail.

More about error causes properties

On Error Properties

The On Error tab is part of AutoMate's Error Handling functionality which allows you to determine what the task should do if a particular step encounters an error.

More about on error properties

Notes

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.

More on variables
More on expressions

More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

Sample 1 - Enable Task

<AMENABLETASK MANAGEDTASK="Task2" MANAGEDTASKID="{64E417BC-613B-4303-B23A-93420B42FE04}" />

 

Sample 2 - Disable a password enabled task.

<AMENABLETASK MANAGEDTASK="Task2" MANAGEDTASKID="{64E417BC-613B-4303-B23A-93420B42FE04}" ENABLE="NO" PASSWORD="AM1ys1x8L4WAQda53iu/9VzTQ==aME" />

↑ Top of Page