|
Wait - For process |
Declaration
<AMWAIT ACTIVITY="pointer" ACTION="text (options)" POINTER="text (options)" />
Description
Causes task execution to pause at the current step until the specified process starts or ends. Optionally, a dataset can be populated with information about that process (for example, process name or unique ID).
Practical Usage
Commonly used to wait for an external application to start or end, which could indicate that a process has completed successfully. If the process started / ended then the task could progress.
Parameters
General
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Wait until | Text (options) | Yes | Match |
|
Specifies
the process condition to wait for before proceeding to the next
step. The available options are:
|
Find by name | Text | No | (Empty) |
|
If enabled, specifies the executable name of the process to wait for. This parameter supports wildcard characters (that is, * or ?) to denote partial matches. Either the full path and file name (for example, c:\folderName\processName.exe) or the file name only (for example, processName.exe) may be specified. If the Find by process ID parameter is enabled, this parameter is ignored. |
Find by process ID | Number | No | (Empty) | PROCESSID="3932" | If enabled, specifies the process ID of the process to wait for. If the Find by process name parameter is enabled, this parameter is ignored. |
Create and populate dataset | Text | No | (Empty) | RESULTDATASET="DatasetName" | The name of the dataset to be created and populated with information about the process. More on the fields that this dataset creates can be found below under Datasets. |
Additional Notes
Datasets
A dataset is a multiple column, multiple row container object. This activity creates and populates a dataset containing a specific set of fields in addition to the standard dataset fields. The table below describes these fields (assuming the dataset name assigned was theDataset).
Name | Type | Return Value |
---|---|---|
theDataset.ProcessName | Text | Returns the path and file name of the process's .exe file. |
theDataset.ProcessID | Number | Returns the ID of the process. |
theDataset.WindowTitle | Text | Returns the title of the process's main window. |
theDataset.WindowClass | Text | Returns the class of the process's main window. |
theDataset.WindowHandle | Number | Returns the handle of the process's main window. |
Examples
- 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
Wait for Internet Explorer process to start.
<AMWAIT ACTIVITY="process" RESULTDATASET="theDataset" PROCESS="C:\Program Files (x86)\Internet Explorer\iexplore.exe" />
Example 2
Wait for Internet Explorer process to end.
<AMWAIT ACTIVITY="process" RESULTDATASET="theDataset" PROCESSACTION="end" PROCESS="C:\Program Files (x86)\Internet Explorer\iexplore.exe" />