Task - Enable/Disable

Declaration

<AMTASK ACTIVITY="enable_disable" MANAGEDTASK="text" ENABLE="YES/NO" PASSWORD="text (encrypted)" />

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 task continues execution with no errors.

Practical Usage

Often used to disable execution of other tasks in order for them not to interfere with the currently running task. Normally, a Disable task step could be placed at the beginning the task and an Enable task step could be placed at the end.

General Parameters

Property

Type

Required

Default

Markup

Description

Action

Yes/No

Yes

Yes

ENABLE="NO"

If set to YES (default), specifies enabling of the task. If set to NO, specifies disabling of the 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 drop-down list that appears or manually enter the task name in the provided text-box.

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

Password (optional)

Text

No

(Empty)

PASSWORD="encrypted"

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.

Examples

The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.

Sample 1: Enable a managed task

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

Sample 2: Disable a password protected managed task.

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