Task - Start Subtask

Declaration

<AMTASK MANAGEDTASK="text" PASSWORD="text (encrypted)" />

Description:

Starts another task using the task name specified. When the subtask starts, the parent task will wait for it to complete before continuing. Variables from the parent task are available to the newly started subtask. This activity supports starting both managed and unmanaged (or external) tasks.

Practical Usage

Used to start a secondary task (also known as a child task or subtask) from a "parent" task. Especially useful for code reuse so the same code does not have to be written over and over again. Rather, one task (usually an unmanaged/external task) can be created and called repeatedly.

Parameters

General

Property

Type

Required

Default

Markup

Description

Run a task file

Text

No

(Empty)

TASKFILE=C:\Temp\Task1.aml

If enabled, specifies the .AML file that points to an unmanaged or external task to run.

Start a managed task

Text

No

(Empty)

  1. MANAGEDTASK="Task1"

  2. MANAGEDTASK="Folder1\Task1"

If enabled, specifies the name of the managed task to run. The task must exist in the current machine's default managed task location at runtime or the step will fail.

Note: Later moving the task to another folder or modifying the task name or parent folder name can break this linkage once created.

Password (Optional)

Text

No

(Empty)

PASSWORD="password"

If the task is password protected, this parameter indicates the password that should be used to decrypt it so that it can run.

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.

Sample 1: Start a task file.

 <AMSTARTTASK TASKFILE="C:\Temp\Task1.aml" />

Sample 2: Start a password protected managed task.

 <AMSTARTTASK MANAGEDTASK="Task2" TASKID="{64E417BC-613B-4303-B23A-93420B42FE04}" PASSWORD="AM1J0nE7Y6UQP/qp+Ajw5KWSA==aME" />