Task Functions

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.

Creating & Managing Task Functions

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:

  1. In the Task Builder's Steps pane, click Make new Function. This expands the panel and displays specific parameter fields.

  2. Enter the name, access type and return type of the function. By default a newly created function is named NewFunction.

  3. Click Click to add new line to add a new line of parameters for the function. Multiple parameters can be added for a single function.

  4. Click Expand/Collapse after completion.

To edit an existing Task Function:

  1. In the Task Builder's Steps pane, click the drop-down list that displays existing functions.

  2. Select the function you want to edit.

  3. Make the desired modifications.

  4. Click Expand/Collapse after completion.

To delete an existing Task Function:

  1. In the Task Builder's Steps pane, click the drop-down list that displays existing functions.

  2. Select the function you want to delete.

  3. Click Delete Function.

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:

  • Public - The function is visible and accessible to external tasks.

  • Private - The function is not visible or accessible to external tasks.

Return

Text (options)

The return value. The available options are:

  • Nothing

  • Variable

  • Array

  • Dataset

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:

  • Variable -

  • Array -

  • Dataset -

Optional

Yes/No

Whether the variable is optional or required. If set to NO (default).

Default Value

Text

The variable's default value.

See Also

Sub-Tasks

Variables

Task Variables

Datasets

Arrays

Expressions

Create Variable Action