Hi, I have multiple configuration nodes as follows for a component:
Is it possible to connect these to the python script? If so how?
Thanks!
Hi, I have multiple configuration nodes as follows for a component:
Try the Merge Variables Node
You can right click on it to add and remove additional ports as well.
Hi @azsb1g19 , The Merge Variables Node suggested by @iCFO is correct.
Or you can also chain the 3 nodes one after the other (Node 28 connects to Node 29, Node 29 to Node 30 and Node 30 to Node 24).
Nice hack there chaining the nodes
Flow variables āflowsā downstream, so at the final node you would always have access to previous flow variables.
@bruno29a
Actually Iām a bit unsure about this:
If I print the flow variables, I only get the first configuration in the chain, node 28.
print(flow_variables)
OrderedDict([(āpath-inputā, āC:\Users\alex\Downloads\New folder (2)ā), (āknime.workspaceā, āC:\Users\alex\knime-workspaceā)])
Actually I also get the same with this workflow too:
I figured out that the boolean configuration isnāt giving me a flow variable value?
Make sure you assigned all of your Configuration nodes different parameter / flow variable names.
@iCFO
They are all different:
You donāt see all 3 in the console window if you switch the view to flow variables when you selected a downstream node? Can the component / workflow be uploaded for us to review?
@iCFO
End Provenance Capture Component.knar (12.5 KB)
Just looked at it. The default value for your path variable is currently blank. Put a temporary dummy value in as the Default and re-run it.
Hi @azsb1g19 , Iām not sure how you are printing the values, but just looking at the flow variables, it works on my side.
Sample component:
This is what I entered as value:
My variables for each of the 3 configuration nodes are:
string-input
boolean-input
boolean-input_two
Here are the values I see for each of them:
EDIT: I think I know what the issue is. Not sure if itās a bug, but it looks like the Python Script does not see the flow variables of type Boolean for some reason.
If I use the option āOutput as Integerā for the 2 Boolean nodes, then I am able to see the variables:
I am not able to see all the variables in the Python Script:
And if I do a print(flow_variables)
, I get all the values:
OrderedDict([('boolean-input_two', 0), ('boolean-input', 1), ('string-input', 'test'), ('knime.workspace', 'C:\\Knime\\knime-workspace')])
This is more of an issue with the Python Script node than merging flow variables. As far as your request is concerned, itās resolved in the sense that all the variables are being passed.
You may want to open another thread about passing the variables to Python Script.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.