Dear all,
Here is a feature proposal I would like to discuss with you: I just came across a process where I wanted to remove attributes within a loop. This could be done using "loop attributes" and "select attributes" as its nested operator.
However, I discovered that the loop will be carried out as many times as attributes were in the set at the beginning of the loop. In my case I remove attributes while looping and reuse the result. But still the loop goes over attributes which aren't there anymore after removal.
Feature proposal: Have the option to adapt loop iterations to existent attributes only when reuse of result is activated.
This sample code removes att2 in the first loop. However, in the console is shown that there are still three iterations for att1, att2, att3.
<?xml version="1.0" encoding="UTF-8"?><process version="7.5.001">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="7.5.001" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="generate_data" compatibility="7.5.001" expanded="true" height="68" name="Generate Data" width="90" x="45" y="34">
<parameter key="number_examples" value="25"/>
<parameter key="number_of_attributes" value="3"/>
</operator>
<operator activated="true" class="concurrency:loop_attributes" compatibility="7.5.001" expanded="true" height="82" name="Loop Attributes" width="90" x="179" y="34">
<parameter key="reuse_results" value="true"/>
<process expanded="true">
<operator activated="true" class="select_attributes" compatibility="7.5.001" expanded="true" height="82" name="Select Attributes" width="90" x="45" y="34">
<parameter key="attribute_filter_type" value="regular_expression"/>
<parameter key="regular_expression" value="att2.*"/>
<parameter key="except_regular_expression" value="%{loop_attribute}"/>
<parameter key="invert_selection" value="true"/>
</operator>
<operator activated="true" class="print_to_console" compatibility="7.5.001" expanded="true" height="82" name="Print to Console" width="90" x="179" y="34">
<parameter key="log_value" value="%{loop_attribute}"/>
</operator>
<connect from_port="input 1" to_op="Select Attributes" to_port="example set input"/>
<connect from_op="Select Attributes" from_port="example set output" to_op="Print to Console" to_port="through 1"/>
<connect from_op="Print to Console" from_port="through 1" to_port="output 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="source_input 2" spacing="0"/>
<portSpacing port="sink_output 1" spacing="0"/>
<portSpacing port="sink_output 2" spacing="0"/>
</process>
</operator>
<connect from_op="Generate Data" from_port="output" to_op="Loop Attributes" to_port="input 1"/>
<connect from_op="Loop Attributes" from_port="output 1" 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>
Cheers
Sachs