Macros

Managing 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-2-modificationdate-1743133221833-api-v2.png


You can open the macro dialog via the target structure menu in the lower bar of the function area with option "Manage macros". 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-2-modificationdate-1743133432413-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/thumbnails/164333165/1107-version-2-modificationdate-1743133546726-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-2-modificationdate-1743135470627-api-v2.png


(1) ID: The ID of the macro. Can be copied here.

(2) Description: Text that will later be displayed in the tooltip.

(3) Access: The macro is visible either system-wide or client-wide. Note: Cannot be changed after the first save.

(4) Exclude in export: With this option you can decide whether the macro should be ignored when exporting profiles or when transferring profiles with the Transport Manager.

(5) Functions: Here you can add further functions to the function chain (6). But to keep the example simple, we will not do that now.

(6) Functions contained in macro: The current function chain with all its individual functions. If you mark a function, the parameters of the function are displayed (as usual).

(7) Test macro: The macro can be tested here. If input parameters were used, see (8), you can specify test values for these.

(8) Index, Description, Test value: Optional input parameters (left window). 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 be created.


images/download/attachments/164333165/1110-version-2-modificationdate-1743135554014-api-v2.png


Now use the context menu in the left window (9) and create a new input parameter, which has the index "1". Use test value "5". This test value will be used as the input value for this parameter if you click button "Test macro" (7).


images/download/attachments/164333165/1111-version-2-modificationdate-1743136687771-api-v2.png


As a result of the macro test, you should now get "23".


images/download/attachments/164333165/3-version-1-modificationdate-1743135697046-api-v2.png

Using the macro


If you now use the macro on a node or field, it will look like this. You will see that the macro has one parameter (10). This is the parameter that you just created.


images/download/attachments/164333165/1103-version-2-modificationdate-1743137052952-api-v2.png