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.
Tip:
When configuring diagram rule by attributes, you can filter out diagram features on network source attribute values regarding the other diagram feature attribute values using the following specific SQL statement: WHERE 'OBJECT' = 'IN_DIAGRAM'. For example, to query the diagram feature with a minimum attribute value in the generated diagram, you can set up any Add <XXX> By Attribute Rule tool with an SQL expression based on the following syntax: <attributeName> = (SELECT MIN(<attributeName>) FROM <networkClassName>) WHERE 'OBJECT' = 'IN_DIAGRAM'.
Imagine that you want to create diagrams that will be automatically laid out using the Smart Tree layout with the subnetwork controller at the lowest location in the diagram as the root junction of the tree layout. In this case, prior to the Add Smart Tree Layout tool in your diagram template geoprocessing builder model, you will add the Add Set Root Junction By Attribute Rule tool with the following SQL expression: SUBNETWORKCONTROLLER = 1 AND attributeElevation = (SELECT MIN(attributeElevation) FROM ElectricDevice) WHERE 'OBJECT' = 'IN_DIAGRAM'.
Root junctions set manually and using rules
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.