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.


images/download/attachments/164333165/2186-version-1-modificationdate-1726739980520-api-v2.png


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.


images/download/attachments/164333165/2188-version-1-modificationdate-1726740508382-api-v2.png

Context menu


Option

Description

Export/Import macro

Replace macro on import

You can export macros (".macro") and import them.

Find use of macro

Here you can list the profiles in which this macro is used.

Edit macro

Duplicate macro

Delete macro

Create new macro

Edit, duplicate, delete or create a new macro.

Creating a new macro


Assume the following function chain.


images/download/attachments/164333165/1107-version-1-modificationdate-1734670111959-api-v2.png

images/download/attachments/164333165/1108-version-1-modificationdate-1734670112089-api-v2.png


If you want to create this function chain as a new macro, you will get the following dialogue.


images/download/attachments/164333165/1109-version-1-modificationdate-1734670112101-api-v2.png


(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.


images/download/attachments/164333165/1110-version-1-modificationdate-1734670112111-api-v2.png


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).


images/download/attachments/164333165/1111-version-1-modificationdate-1734670112120-api-v2.png


If you now use the macro on a node or field, it looks like this.


images/download/attachments/164333165/1103-version-1-modificationdate-1734670112129-api-v2.png


Enter the value "5" for parameter a. As a result in a mapping test, you should now get "23".