This online help file is for the Advanced Workflow Engine v8. For other versions, please refer to http://help.globalscape.com/help/index.html. (If the Index and Contents are hidden, click Show Contents pane in the top left corner of this topic.) |
In programming, a function normally performs a calculation and returns a value. For example, the SUM function adds the sum of a range of values. Each function does its thing and returns a value. The power of functions comes from their ability to provide logical structure to an otherwise disorganized collection of task steps or statements and supply variable protection and modularity. This is accomplished through two distinct yet complimentary standards.
NOTE: Users can continue to build tasks as they did before and may choose to use these new features at their own pace.
Sub-tasks are task files that are executed within another task by using the Start Task action. In this situation, the parent task’s (i.e. the task executing the Start Task step) public functions, public extended functions, public task variables, and any local variables marked as public created up to point where the Start Task step is encountered, are accessible to the sub-task. All other variables and functions are not accessible to the sub-task. Conversely, because the Start Task action is a synchronous operation, the sub-task’s public functions and public task variables are not accessible from the parent task. This is fully backward compatible with previous versions of AWE, since in the past there was only one “function” (what is now called “main”), no task variables, and all (local) variables and extended functions were considered public.
Task functions exist at the root of a task structure, and thus their scoping is to the entire task. Their accessibility, however, can be either public or private (accessibility defines whether or not the function is accessible and visible to an external task). This is done by setting the ACCESS attribute of the AMFUNCTION element to either public or private. By default task functions have public accessibility.
To create a new Task Function:
In the Task Builder's Steps pane, click the Make new Function button. This expands the panel and where specific parameters can be set.
Enter the name, access type and return type of the function. By default a newly created function is named NewFunction.
Click the Click to add new line button to add a new line of parameters for the function. Multiple parameters can be added for a single function.
Click the Expand/Collapse button after completion.
To edit an existing Task Function:
In the Task Builder's Steps pane, click the drop-down button that displays existing functions.
Select the function you want to edit.
Make the desired modifications.
Click the Expand/Collapse button after completion.
To delete an existing Task Function:
In the Task Builder's Steps pane, click the drop-down button that displays existing functions.
Select the function you want to delete.
Click the Delete Function button.
The following table describes the parameters available during task function creation/modification.
Property |
Type |
Description |
Name |
Text |
The name of the function to create. This parameter defaults to the name NewFunction. |
Access Type |
Text (options) |
The task function's access type. The available options are:
|
Return |
Text (options) |
The return value. The available options are:
|
The following table describes the parameters available when adding new parameters to a task function.
Property |
Type |
Description |
Name |
Text |
The name of the parameter to create. |
Type |
Text (options) |
The parameter type. The available options are:
|
Optional |
Yes/No |
Whether the variable is optional or required. If set to NO (default). |
Default Value |
Text |
The variable's default value. |