Bookmark and Share Share

Defining and Using Custom Mashup Statements with Macros

You can create user-defined statements for use in mashup scripts using the <macro> statement in EMML. Macros are basically snippets of mashup logic that can accept input parameters and produce output. They can do anything that you can do in a mashup, except define or call another macro.

Macros can be defined in a single mashup. See <macro> for basic instructions on defining a macro.

Macros can also be defined in macro libraries so that they can be shared by many mashups. See <macros>, Creating a Macro Library, Deploying Macro Libraries in an EMML Engine and Including Macro Libraries in Mashup Scripts or Macro Libraries for instructions.

Once you have defined macros, you use them in mashup scripts much like any other mashup statement. See <macro:custom-macro-name> and Calling a Macro in a Mashup Script for instructions.

The EMML Reference Runtime Engine also has some built-in macros that provide additional capabilities for mashups. See Opening and Using XML Files in Mashups, Formatting Results as CSV and Generating Mashup Scripts Dynamically for information on these built-in macros.