I am currently trying to optimize my workflow a bit.
Right now I am using a Column Expressions Node to replace a cell value in a column “Volume” with a flow variable called volume (this flow variable changes inside a parameter optimization loop).
To define the cell that is being replaced in the current parameter optimization loop, I use the iteration of an outer loop I am doing (so the first outer loop switches the value in the first row, the second outer loop changes the Volume value in the second and so on).
This is the code I am using inside the Column Expression Node right now, the node is set up to replace the column Volume:
if (rowIndex()== variable("IterationOuterLoop"))
{
variable("Volume")
}
else
{
column("Volume")
}
And this is the part of the current workflow, the values get changed in the Column Expression Node, I then calcuate a difference to target and that is being outputted to the parameter optimization loop end.
Now I recently found out that a Column Expression is a pretty slow way of doing something like this (Any plans to speed up Column Expression node? - #2 by andres_sommerh).
So now I want to take a speedier approach to things by replacing the Column expression node with a Java snippet or any other faster way.
The point is that i do not know how to write the javacode for something like this. And it would be fantastic if some of you guys could help me with it
These are the three main components that run in the workflow, the rest are just single Nodes that do not impact performance.
Honestly I cannot tell you why it works so much quicker, these three components contained a single column expression each. Changing these three nodes to a rule engine gave me an 88% boost in execution time without changing anything else.
IT’s important to note that each of these column expressions / rule engines run in a nested loop, so they are executed a couple of hundred to thousand times everytime the workflow runs.