Task - Call function
Declaration
<AMTASK ACTIVITY="call_function" FUNCTIONNAME="text" RESULTVARIABLE="text" />
Description
Calls a function defined in the task. If the function returns a result, you can specify the name of the variable in which to place the value. For more details, see Task Functions.
NOTE: Using a percentage character (%) to
delimit variables is optional, however, all string literals (strings
to be taken as themselves) must be surrounded by double quotes
(for example, "string literal").
Practical usage
Used to pass control to a subroutine; after the subroutine is executed, control returns to the next instruction in main task.
Parameters
General
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Function name to call | Text | Yes | (Empty) | FUNCTIONNAME="thefunction" | The name of the function to call. To create a task function, see Task Function. |
Return result into variable | Text | No | (Empty) | RESULTVARIABLE="theVar" | The name of an existing variable to populate with the results of the call function. |
Example
NOTE:
- Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
- To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.
Description
This sample task calls the function theFunctionName and populates the theVariableName with the results.
Copy
<AMTASK ACTIVITY="call_function" FUNCTIONNAME="theFunctionName" RESULTVARIABLE="theVariableName" />