Macros
Macros offer the possibility to encapsulate and reuse function chains. This allows the compact use of function chains and a central maintenance of these. Changes to a macro affect all profiles that use this macro. Macros can be defined system-wide or client-specific.
You can open the macro dialog (2) via the menu (1) in the lower bar of the function area. Either to create the existing function chain as a new macro or to display the overview of all macros. Note: You can copy the ID of a macro in the opened macro.
Creating a new macro
Assume the following function chain.
If you want to create this function chain as a new macro, you will get the following dialogue.
(1) The ID of the macro. Can be copied here.
(2) Description text that will later be displayed in the tooltip.
(3) The macro is visible either system-wide or client-wide. Note: Cannot be changed after the first save.
(4) With this option you can decide whether the macro should be ignored when exporting profiles or when transferring profiles with the Transport Manager.
(5) Here you can add further functions to the function chain (6). But to keep the example simple, we will not do that now.
(6) The current function chain with all its individual functions. If you mark a function, the parameters of the function are displayed (as usual).
(7) The macro can be tested here. If input parameters were used, see (8), you can specify test values for these.
(8) Optional input parameters. See following section.
Creating input parameters for the macro
If you save the macro created above, you can already use it on fields and nodes. The example above, however, is very simple and not really helpful in this form. Often, as you are used to from most functions, you also want to use input parameters.
For this task, there is a special input parameter type "Parameter" for macros only, which you can select instead of any of the input parameters in the function chain. See the following example.
Example
Highlight parameter a of the first function in the chain, change the type to "Parameter" and change the value from "4" to "1". The value is the parameter index. However, in order for this to be used, an input parameter must first be created.
Use the context menu in area (9) and create a new input parameter, which has the index "1". That is the value you entered above. You can optionally specify a description and a test value. The test value is used as the input value for this parameter if you execute (10).
If you now use the macro on a node or field, it looks like this.
Enter the value "5" for parameter a. As a result in a mapping test, you should now get "23".