The Set Root Junction rule is used to specify junctions based on a network junction class or object table as diagram root junctions by filtering those junctions based on their attributes, if any.
Since the root junctions are specific junctions from which tree layouts operate when they run on network diagrams, this rule is typically configured on templates that are set up to automatically run tree layouts at diagram generation.
Set Root Junction rule process
The Set Root Junction rule must be set up on a template before configuring any tree layouts—Smart Tree, Mainline Tree, or Radial Tree—so that the expected roots are positioned by the rule first, and the automatic tree layout operates from those root junctions.
In most cases, this rule is the last rule configured on the template rule sequence, so it runs after all rules that modify the diagram graph. This ensures that the Set Root Junction rule processes all junctions that exist in the diagram.
Set Root Junction rule configuration
You can add a Set Root Junction rule on a template with the Add Set Root Junction By Attribute Rule tool.
In some situations, you may consider configuring this tool with an SQL expression to set a particular diagram junction as the root junction. For example, to query the minimum attribute value from the diagram junctions in the generated diagram, you could run the tool with the following SQL expression: <attributeName> = (SELECT MIN(<attributeName>) FROM <networkClassName>) WHERE 'OBJECT' = 'IN_DIAGRAM'.
Root junctions set manually and via rule
A diagram can mix roots set by rules and roots set manually using the Set Root Junction tool; in other words, you can manually set other root junctions or remove existing root junctions in a diagram that comes with predefined root junctions at its generation/update.
However, most of the time, the root junctions that were manually set will be lost when updating such a diagram. Only the root junctions set by the Set Root Junction By Attribute rule should be kept at the end of diagram updates. The only exception is when no junction is set during the rule process; in that case, root junctions that were manually set in the diagram before its update are kept as root junctions in the updated diagram.