How to set the priority of a macro

You can control the priority of a macro (i.e. the order in which it is processed) via an internal value “priority”.

You can also query some internal values within a macro of the type “XWiki.WikiMacroClass”.

Thus
xcontext.getMacro()[“context”].getId()

returns the name of the document from which the macro was called.

Thus
xcontext.getMacro()[“context”].getId()

gives the own priority of this macro (“100”)

My question:

Is there a possibility to set the priority, for example to achieve that similar to the toc macro, the macro is always executed at the end, or is this only possible with JAVA macros?

Norbert

Wiki macros simply don’t have the possibility to define their priority right now, seems to be https://jira.xwiki.org/browse/XWIKI-14883. I don’t see any strong technical reason for this limitation, was just forgotten I think.

By the way this way of accessing wiki macro bindings is deprecated since a little while (10.11.9, 11.6, 11.3.2) so if you target a more recent version of XWiki you might want to take a new look at https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/WritingMacros/WikiMacroTutorial/ (there is also new tools for wiki macros).