Consistent loop behaviour when iterating zero times
tennenrishin
New Altair Community Member
The following process generates an error when it runs, simply because the number of loop iterations happens to be zero. But if any other number of attributes matched, there would not have been an error.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>Certain loop operators (e.g. Loop Attributes) can be considered a repetitive chain of their contents. Extrapolating this principle down to zero iterations, the consistent behavior would be that the loop operator has no effect (rather than generating an error).
<process version="5.2.006">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.2.006" expanded="true" name="Process">
<process expanded="true" height="486" width="907">
<operator activated="true" class="generate_data" compatibility="5.2.006" expanded="true" height="60" name="Generate Data" width="90" x="112" y="75"/>
<operator activated="true" class="loop_attributes" compatibility="5.2.006" expanded="true" height="60" name="Loop Attributes" width="90" x="313" y="75">
<parameter key="attribute_filter_type" value="regular_expression"/>
<parameter key="regular_expression" value="regexThatMayMatchZeroAttributes"/>
<process expanded="true" height="486" width="907">
<connect from_port="example set" to_port="example set"/>
<portSpacing port="source_example set" spacing="0"/>
<portSpacing port="sink_example set" spacing="0"/>
</process>
</operator>
<connect from_op="Generate Data" from_port="output" to_op="Loop Attributes" to_port="example set"/>
<connect from_op="Loop Attributes" from_port="example set" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>
Tagged:
0
Answers
-
Hi, thank's for the hint, indeed some of the loop operators need some love.0