Using Functions as Called Functions
A function that is added into another function is referred to as a called function. This function may or may not include variables with published inputs and/or outputs.
Creating called functions
To create a called function:
- Open a new function.
- Create the requested user-defined variables. For each variable, define the publishing direction:
- In – Used as an input for the current function.
- Out – Used as an output of the current function.
- InOut – Can be used as either an input or output of the current function.
- Edit the function sequence by adding the requested tools, variables, assets, etc.
- Save the function.
- You can now use this function as a called function in other functions.
Using called functions
To call a function:
- Open the function into which to insert the called function (new or existing function).
- From the Workspace explorer, drag and drop your function into the requested location on the function canvas.
The called function is represented on your canvas as a single or triple step (while using Transformation or Criteria).
- Double-click the Function step to open the + panel.
-
Click the IO tab to modify the function's inputs and outputs.
-
Enter values into the inputs and set the variables to which the outputs will be assigned.
You can call a function from within the same function, thus creating a recursive call. Functions can be nested to create a hierarchy of an unlimited number of functions within other functions.