Using flow variables in rule-based row splitter

Hi everyone. I am trying to use components to clean up my workflow for the first time, so apologies in advance :grinning:.
Each component contains a rule-based editor to select rows based on whether certain columns contain a specified number of values or not (from a bin-sum table):

($Intensity_MDT_log2_bin_sum$ >= 2 AND $Intensity_WDT_log2_bin_sum$ >= 2) => TRUE

I wanted to be able to configure the min number of values present in both sets of 4 columns.
Therefore, within each component I have placed a integer configuration node in order to create a flow variable for the min number of values present in each set of columns. The variable outport of this is connected to the variable inport of the rule-based editor and the rule updated to:

($Intensity_MDT_log2_bin_sum$ >= $${Irepno}$$ AND $Intensity_WDT_log2_bin_sum$ >= $${Irepno}$$) => TRUE

The integer config. node has the expected variable output table and the component gives the expected dialog box. However, the rule-based editor does not function and I get the following warning on the console:

WARN Rule-based Row Splitter 0:1083:0:1041 Errors loading flow variables into node : Expected an operator

Any suggestions?

Phil

Hello @0nly4phil,

are flow variable $Intensity_MDT_log2_bin_sum$ and $Intensity_WDT_log2_bin_sum$ created inside or outside Component(s) where you are using them? If outside then you need to explicitly allow them to be visible inside Component. See here for more:
https://docs.knime.com/latest/analytics_platform_components_guide/index.html#flow-variable-scope

Br,
Ivan

2 Likes

Hi ipazin, in the following rule-

($Intensity_MDT_log2_bin_sum$ >= $${Irepno}$$ AND $Intensity_WDT_log2_bin_sum$ >= $${Irepno}$$) => TRUE

$Intensity_MDT_log2_bin_sum$ and $Intensity_WDT_log2_bin_sum$ are the columns containing the number of values present in each collection of 4 columns.

$${Irepno}$$ is the flow variable repno (integer) which is the minimum number of values present desired. The flow variable repno is the same for both columns. It is created inside the component.

1 Like

Hi @0nly4phil , might be better if you can share your workflow to see what you are doing.

2 Likes

Hello @0nly4phil,

Sry. My mistake. Assumed those are flow variables also and didn’t look at syntax carefully enough to realize they are not. I have just tried Rule-based Row Filter node inside Component with your setup and worked as expected. So as @bruno29a already suggested sharing workflow example could help us figure out this one. (Dummy data works just fine.)

Br,
Ivan

1 Like

This is embarrassing… I recreated the sub-component of the workflow (attached) in Knime Analytics platform 4.4.0 and it worked fine. I replaced the faulty sub-component with the working one and it also works fine now.

Sorry for unnecessarily taking up your time, but thanks!

Phil

1 Like

Hello @0nly4phil,

all fine. Glad to hear it’s working now.

Br,
Ivan

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.