Mashups in MashZone NextGen Wires : Customizing Wires : Adding Custom Blocks to MashZone NextGen Wires Using Macros : Define Inputs and Output for 'Wiring' the Macro
Define Inputs and Output for 'Wiring' the Macro
The macro will end up as a block in a Wires graph that is connected to other blocks. To enable 'wiring', the macro must have at least one <input> statement that can be wired to other blocks. The macro must also have an <output> statement to allow the results of the block to be wired to another block in the mashup. For example:

<macros xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.openmashup.org/schemas/v1.0/EMML/ ../src/schemas/EMMLSpec.xsd"
xmlns="http://www.openmashup.org/schemas/v1.0/EMML"
xmlns:presto="http://www.jackbe.com/v1.0/EMMLPrestoExtensions"
domain = "myCustomMath">

<macro name="GetSessionPercentages">
<!-- Spreadsheet with Session data as input -->
<input name="spreadsheet" type="document" />
<output name="result" type="document" />
....
</macro>
...
</macros>>
In many cases, some of the <input> statements are a document type to accept complex, structured results from other blocks. The <output> statement also typically is a document type. However, this is not required. Both <input> and <output> statement types can be string or any other type that meets your needs.
This next example works with a 'well-known' input, in this case a spreadsheet mashable. You can also design macros to work with generic inputs (see Make Macros Generic for Custom Blocks).
Copyright © 2013-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback