Task - Enable/Disable

Declaration

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

Related Topics   

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.

Parameters

General

Property Type Required Default Markup Description
Enable/Disable Yes/No Yes Enable ENABLE="NO" Enables (YES) or disables (NO) a managed task. This parameter is set to Enable by default.
Managed Task Text Yes (Empty)
  • MANAGEDTASK="Task1"
  • MANAGEDTASK="Foldername\Task1"
Specifies the name of the managed task. Click the drop-down combo box to select the desired task from the list that appears or manually enter the task name.
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="text (encrypted)" If the task you wish to enable/disable was 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.

Description

Error Causes

On Error

Examples

NOTE:
  • The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
  • Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.

Example 1

This sample task enables a password protected managed task.

Copy
<AMTASK ACTIVITY="enable_disable" MANAGEDTASKID="{F1B63818-B577-46B5-9EED-E3A3E5F5D1A0}" MANAGEDTASK="Samples\About - Sample Tasks" PASSWORD="AM5BQbQdJgNxAcdkESIlXV+pQ==aME" />

Example 2

This sample task disables a password protected managed task.

Copy
<AMTASK ACTIVITY="enable_disable" MANAGEDTASKID="{F1B63818-B577-46B5-9EED-E3A3E5F5D1A0}" MANAGEDTASK="Samples\About - Sample Tasks" ENABLE="NO" PASSWORD="AM5vADJYKYpw8rvBGyASI8m9A==aME" />