<return>
This statement forcibly stops all further mashup or macro processing and returns the current value of <output> as the mashup or macro result.
You don't need to supply any additional information or content for <return/>.
Can Contain | Empty |
Allowed In | mashup | catch | else | elseif | for | foreach | if | macro | operation | sequence | try | while |
Forcibly Stopping Mashup or Macro Processing
This example checks to ensure that filter results contain at least one row. If not, it constructs a result with an error message and uses <return/> to stop all further processing.
...
<output name="result" type="document"/>
<!-- invoke mashable and filter results to $rows variable-->
<if condition="empty($rows)">
<variable name="msg" type="string"/>
<assign fromexpr="concat('No rows meet your criteria: ',$filterBy)"
outputvariable="msg"/>
<constructor name="result">
<rows>
<error>{$msg}</error>
</rows>
</constructor>
<return/>
</if>
...