Appendix : Legacy Presto components : Mashables and Mashups : Mashups in EMML : Advanced Mashup Techniques : Defining and Using Custom Mashup Statements with Macros : Calling a Macro : Calling Macros From Another Macro
Calling Macros From Another Macro
Calling a macro from within another macro has the same requirements of calling a macro from a mashup:
*Adding the Macro Reference Namespaceto <macro>.
*If the macro belongs to a user-defined domain, including the Macro Domains.
*Using the macro reference statement.
For example:
<macro name="reusableMacroWithNestedCall"
xmlns:presto="http://www.jackbe.com/v1.0/EMMLPrestoExtensions"
xmlns:macro="http://www.openmashup.org/schemas/v1.0/EMMLMacro">
<input name="currentUser" type="string" />
<output name="macroResult" type="string"/>
<variable name="currentActivity" type="document"/>
<variable name="updatedPoints" type="number"/>

<!-- logic to determine current activity, assign to $currentActivity -->

<include domain="UserMath"/>
<macro:calculatePoints domain="UserMath" thisUser="$currentUser"
activity="$currentActivity" outputvariable="updatedPoints"/>
<display console="true" message="Updated points are"
variable="$updatedPoints"/>
...
</macro>
Copyright © 2013-2017 Software AG, Darmstadt, Germany. (Innovation Release)

Product LogoContact Support   |   Community   |   Feedback