Rule Engine equivalant to add (one) additional row instead of column?

My current issue is that I want to add as a row, instead of a column. I only have a single row with two columns, the new row has identical contents.This is for running in a loop.

I currently solved this by giving the single row in my loop a new RowID each iteration, then I use concatenate with the single (repeating row). This gives for each iteration a warning message from the RowID.


See picture, in case my blabbering isn't that clear.

I have used in other cases Rule-Engine to succesfully add a new column upon a certain condition, so I wonder if this or similar could be use for Row?

I imagine my problem is easier to solve in java or python, but since I don't know them very well....

Maybe you can use Cross-joiner's cartesian product feature to your advantage. That is if I understood correctly your problem you want to duplicate your single row with two columns when a certain condition is met.

One way to use cartesian products for this task is as follows:

  • use Integer input node and define a flow variable (e.g. rows) and allocate the number of desired rows;
  • connect this node to the input flow variable port of the Empty table creator. No need for random seed or skipping (set it to 0);
  • in the Empty table creator, select the flow variable in the flow variable tab under the cfg_nr - by the way, no need to add any column to this table ;
  • connect the thus created table as well as your own table to the cross-joiner node.

This effectively duplicates the single row table by the number of rows defined by the flow variable in the other table. Of course, the flow variable could also come from another source than the manual integer input node.

In a loop, you could even use this construct without any flow variable to add a single row each time a given condition is met in your table or row or whatever...

Couldn't you just transpose -> Rule Engine -> Transpose?

Or am I missing something obvious???

Well, Rule-Engine -> Transpose, yes. Though that seems to make my loop 10% slower interestingly. It becomes evident after thousands to thens of thousands of iterations. 100 loops/sec vs. 90loops/sec on my machine.

I was testing an empty row creator, but since I want to inject a molecule (as smile string) I get an error back.

I'll do some more testing with your suggestion.

So no Java snippet alternative? That's interesting. I

Yes, this could work. Add Empty Rows (just one) and than in the java snippet check until all cells are missing and than fill them them.

But i doubt this will be very fast.