Task Template for IDL 8.5.2
This topic describes the fields (also called keys) in a task template for use with IDL 8.5.2.
Task Keys
This table describes the keys that provide an overview of the task. Refer to IDLTask for additional details.
Key |
Required |
Description |
name
|
Yes, if storing the task definition to disk
|
A string with the name of the task. This name is used when calling the IDLTask function to create an instance of the task. The name of the task file must match the value of this key and must be a valid IDL variable name.
|
base_class
|
Yes |
A string with the name of the class to use; the most common is IDLTaskFromProcedure.
|
schema
|
Yes |
A string containing the schema of the task definition. The schema is: idltask_1.0 . IDL will support this schema in future releases if a new schema is introduced.
|
routine
|
Yes, when used with IDLTaskFromProcedure
|
The routine that is called when Task.Execute is invoked.
|
display_name
|
No |
A string with the name of the task for display purposes. Spaces and special characters are allowed.
|
description
|
No |
A string with a description of the task.
|
parameters
|
No |
A LIST of HASHs of key/value pairs, described in the Parameter Keys table below.
|
Parameter Keys
This table describes the keys that belong to the parameters group in a task definition; these are repeated for each parameter. Depending on the parameter type, there can be additional keys. Refer to the IDLParameter* topics to find out specific information about a given parameter. The mapping of the parameter properties to the task definition is 1:1, if the parameter property name is TEST_EXACT then the task definition key is test_exact.
Key |
Required |
Description |
name
|
Yes |
The name of the parameter as it appears to the end user. This key must be a valid IDL variable name.
|
type
|
Yes |
A scalar string indicating the parameter type to use on creating an instance of the task.
Basic scalar data type string values are:
BYTE, INT, UINT, LONG, ULONG, LONG64,ULONG64, FLOAT, DOUBLE, COMPLEX, DCOMPLEX, STRING, BOOLEAN, LIST, HASH, DICTIONARY, ORDEREDHASH
Basic array data types must include the dimensions key and type string values are:
BYTEARRAY, INTARRAY, UINTARRAY, LONGARRAY, ULONGARRAY, LONG64ARRAY,ULONG64ARRAY, FLOATARRAY, DOUBLEARRAY, COMPLEXARRAY, DCOMPLEXARRAY, STRINGARRAY, BOOLEANARRAY
The type key value can be set to a class name to indicate that the user must provide an object of the given class name.
|
dimensions
|
No for scalar, Yes for array
|
A scalar string specifying the required dimensions for a parameter, if type specified is an *ARRAY type.
If the number of elements in any dimension does not matter, then use an asterisk ('*') for that dimension.
- Example of a three-element array declaration: "[3]"
- Example of a 1D array with any number of elements: "[*]"
- Example of a 2D array with any number of columns or rows: "[*, *]"
- Example of a 2D array with a specific number of elements: "[3, 256]"
- Example of a 2D array with any number of columns and 3 rows: "[*, 3]"
|
keyword
|
No |
The internal keyword that the parameter should map to when invoking the routine. If it is the same as the name key, then you do not need to create this key. |
display_name
|
No |
A string with the name of the parameter for display purposes. Spaces and special characters are allowed.
|
description
|
No |
A string with a description of the parameter. |
direction
|
No |
Specify if the parameter is input or output. If this key is not set, then direction defaults to input.
|
required
|
No |
A boolean value that indicates whether the parameter is required or not. The default is false, which allows the parameter to be optional.
|
default
|
No |
The default value of the parameter if the end user does not provide a value.
|
hidden
|
No |
A boolean value that indicates whether the parameter is visible to the user or not. The default is false, which means the user can see it and set its value. Set this key to true to prevent the user from seeing the parameter or changing its value. You must also set the default key to the desired value.
|
additional keys
|
No |
Depending on the parameter there may be additional keys available to define. For example for a type set to STRING, there is fold_case and choice_list. You could use the QueryProperty static method on the given parameter class to discover the available keys:
IDL>print, IDLParameterString.QueryProperty()
|
Revision History
Task templates were introduced in this version.
See Also
Task Schema History, Custom IDL Tasks