Integrate Software AG Products Using Digital Event Services 10.4 | Integrate Software AG Products Using Digital Event Services | MashZone NextGen Help | Appendix | Legacy Presto components | Mashables and Mashups | Mashups in EMML | Advanced Mashup Techniques | Defining and Using Custom Mashup Statements with Macros
 
Defining and Using Custom Mashup Statements with Macros
You can create user-defined statements for use in mashup scripts or macros using the <macro> statement in EMML. Macros can also be used as custom action blocks to extend mashup capabilities in Wires.
Macros are basically snippets of mashup logic that can accept input parameters and produce output or exceptions. They can do anything that you can do in a mashup, but they can only be used in a mashup or another macro.
Note: In previous releases, macros could not call other macros nor could macros be defined within macros. These limitations no longer apply.
There are two ways to create macros depending on how you need to use them:
*Inner macros are defined in a single mashup or macro. You can only use inner macros in the mashup or macro where they are defined.
See <macro> for basic instructions on defining a macro.
*Reusable macros are defined in macro libraries so that they can be used in any mashup or macro. See <macros>, Creating and Registering Macros and Including Macro Domains in Mashup Scripts or Macros for instructions.
Once you have defined macros, you use them in mashup scripts or other macros much like any other mashup statement. See <macro:custom-macro-name> and Calling a Macro for instructions.
You can also provide metadata for macros using <presto:macro-meta>. This metadata determines whether a macro can be used as a custom Wires block. If so, it can also provide configuration for the custom block. See Adding Custom Blocks to MashZone NextGen Wires Using Macros for more information on adding macros to Wires and configuring them as custom action blocks.
The MashZone NextGen Server also has some built-in macros that provide additional capabilities for mashups. See Generating Mashup Scripts Dynamically for information on these built-in macros.

Copyright © 2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release