Wait - For Duration

Declaration

<AMWAIT SCALAR="number" MEASURE="minutes" />

Description: Pauses task execution at the current step for a specific amount of time. The duration can be set to hours, minutes, seconds or milliseconds.

Practical Usage

Typically used to wait a certain amount of time for something to occur (which is normally beyond the control of the task) before proceeding, such as when a specific condition starts, stops or changes. For example, wait 10 seconds to ensure a particular web page has completely loaded or wait 5 minutes to make certain a specific process has finished.   

General Parameters

Property

Type

Required

Default

Markup

Description

Wait for

Number

Yes

(Empty)

SCALAR="20"

The duration of time to wait. This value corresponds directly with the Measure parameter (more details below).

Measure

Text (options)

Yes

seconds

  1. MEASURE="milliseconds"

  2. MEASURE="seconds"

  3. MEASURE="minutes"

  4. MEASURE="hours"

The time measurement to use in accordance with the value entered in the Wait for parameter. The available options are:  

  • Milliseconds - The duration will be measured in milliseconds.

  • Seconds (default) - The duration will be measured in seconds.

  • Minutes - The duration will be measured in minutes.

  • Hours - The duration will be measured in hours.

Description tab - A custom description can be provided on the Description tab to convey additional information or share special notes about a task step.

Error Causes tab - Specify how this step should behave upon the occurrence of an error. (Refer to Task Builder > Error Causes Tab for details.)

On Error tab - Specify what AWE should do if this step encounters an error as defined on the Error Causes tab. (Refer to Task Builder > On Error Tab for details.)

Examples

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

Description: This task executes a 'Wait for duration' step according to the value (in seconds) specified.

<AMVARIABLE NAME="duration" />
<AMSHOWDIALOG ACTIVITY="input" 
MESSAGE="How many seconds should the next step wait before proceeding?" 
DEFAULTVALUE="5" RESULTVARIABLE="duration" 
WINDOWTITLE="Wait Duration" />
<AMWAIT SCALAR="%duration%" />
<AMSHOWDIALOG>Well, what do you know! %duration% 
seconds has passed. Thanks for participating.</AMSHOWDIALOG>