0 / 0
SuperNode properties
Last updated: Jan 18, 2024
SuperNode properties

The tables in this section describe properties that are specific to SuperNodes. Note that common node properties also apply to SuperNodes.

Table 1. Terminal supernode properties
Property name Property type/List of values Property description
execute_method Script Normal  
script string  

SuperNode parameters

You can use scripts to create or set SuperNode parameters using the general format:

mySuperNode.setParameterValue("minvalue", 30)

You can retrieve the parameter value with:

value mySuperNode.getParameterValue("minvalue")

Finding existing SuperNodes

You can find SuperNodes in flows using the findByType() function:

source_supernode = modeler.script.stream().findByType("source_super", None)
process_supernode = modeler.script.stream().findByType("process_super", None)
terminal_supernode = modeler.script.stream().findByType("terminal_super", None)

Setting properties for encapsulated nodes

You can set properties for specific nodes encapsulated within a SuperNode by accessing the child diagram within the SuperNode. For example, you can create a Derive node and set the mode and field name extension as follows:

process_supernode = modeler.script.stream().createAt("process_super", "My SuperNode", 200, 200)
childDiagram = process_supernode.getChildDiagram()
derivenode = childDiagram.createAt("derive", "My derive", 100, 100)
derivenode.setPropertyValue("mode", "Multiple")
derivenode.setPropertyValue("name_extension", "new_derive")

Creating SuperNodes

If you want to create a SuperNode and its content from scratch, you can do that in a similar way by creating the SuperNode, accessing the child diagram, and creating the nodes you want. You must also ensure that the nodes within the SuperNode diagram are also linked to the input and/or output connector nodes. For example, if you want to create a process SuperNode:

process_supernode = modeler.script.stream().createAt("process_super", "My SuperNode", 200, 200)
childDiagram = process_supernode.getChildDiagram()
filternode = childDiagram.createAt("filter", "My Filter", 100, 100)
childDiagram.linkFromInputConnector(filternode)
childDiagram.linkToOutputConnector(filternode)
Generative AI search and answer
These answers are generated by a large language model in watsonx.ai based on content from the product documentation. Learn more