Mashups in EMML : Advanced Mashup Techniques : Defining and Using Custom Mashup Statements with Macros : Creating and Registering Macros : Create an Individual Reusable Macro
Create an Individual Reusable Macro
1. To define a macro
*That is an inner macro, start a new mashup or open an existing mashup in the Mashup Editor. Add a <macro> statement from the Actions menu on the appropriate line.
Inner macros defined in a mashup script can only be used within that mashup.
*That is reusable in any mashup or in other macros, expand the Macros menu in the Mashup Editor and click Add New Macro.
2. Enter a name for the macro in the name attribute on <macro>.
<macro name="myMacro">
...
</macro>
Macro names must be valid XML names as they become the element name for the custom EMML statement defined by the macro. They must also be unique within the domain in which you register them.
3. If this macro should be used as a custom block in Wires, add the MashZone NextGen Mashups Extensions namespace to the <macro> element.
Note:  
See EMML Namespaces for the current MashZone NextGen Extensions Namespace.
For example:
<macro name="myMacro"
xmlns:presto="http://www.jackbe.com/v1.0/EMMLPrestoExtensions">
...
</macro>
4. To allow this macro to call other macros, add the macro reference namespace to the <macro> element.
See EMML Namespaces for the current Macro Reference Namespace.
For example:
<macro name="myMacro"
xmlns:presto="http://www.jackbe.com/v1.0/EMMLPrestoExtensions"
xmlns:macro="http://www.openmashup.org/schemas/v1.0/EMMLMacro">
...
</macro>
5. To allow this macro to call macros from other domains, add <include> elements identifying each domain. See Including Macro Domains in Mashup Scripts or Macros for instructions.
Note:  
This step is not required for global macros.
6. Add <input> and <output> parameters, other EMML statements or calls to other macros to define the logic of the macro. See <macro> for details and examples.
7. For reusable macros, click Save As to save and register the macro.
a. Enter the name for the macro.
b. Enter a Domain Name to register this macro to a specific domain. If you leave the domain blank, the macro is registerd as a global macro.
Domain names ensure that macro names are unique. For macros designed to be custom blocks in Wires, the domain also defines the menu category where the custom block appears. Domain names:
*Must be unique.
*Are case sensitive.
*Can contain letters, numbers, periods (.), dashes (-) and underscores (_).
c. Click Save.
The Macros menu updates and lists any new macros that are defined within a domain.
Copyright © 2013-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback