<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Attribute Rule to add an Object record to both terminals of a device in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-add-an-object-record-to-both/m-p/1384067#M1299</link>
    <description>&lt;P&gt;Thanks I can reproduce it looks like a bug when the association is being added in multiple payloads, we will take a look.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Meanwhile the workaround is to group all associations in one payload.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;return { 
"edit": [
    {  
    "className" : "ElectricDistributionJunctionObject", 
    "adds" : [{
        "tag": "unit1",
        "attributes": {
            "assetgroup": 2,
            "assetType": 1}
             }]},
    {
    "className": "^UN_Association",
 
    "adds": [{
            "fromClass": "ElectricDistributionJunctionObject",
            "fromGlobalId": $feature.GLOBALID,
            "toClass": "ElectricDistributionJunctionObject",
            "toGlobalId": "unit1.globalID",
            "associationType": "containment"
            },
{
            "fromClass": "ElectricDistributionJunctionObject",
            "fromGlobalId": $feature.GLOBALID,
            "toClass": "ElectricDistributionJunctionObject",
            "toGlobalId": "unit1.globalID",
            "fromTerminal": "Source",
            "associationType": "connectivity"
            },
{
            "fromClass": "ElectricDistributionJunctionObject",
            "fromGlobalId": $feature.GLOBALID,
            "toClass": "ElectricDistributionJunctionObject",
            "toGlobalId": "unit1.globalID",
            "fromTerminal": "Load",
            "associationType": "connectivity"
            }
]},
   
         ]
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Feb 2024 18:25:58 GMT</pubDate>
    <dc:creator>HusseinNasser2</dc:creator>
    <dc:date>2024-02-19T18:25:58Z</dc:date>
    <item>
      <title>Attribute Rule to add an Object record to both terminals of a device</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-add-an-object-record-to-both/m-p/1384062#M1298</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been working with Utility Network version 6 and ArcPro 3.1.&amp;nbsp; My UN has features and non-spatial objects.&amp;nbsp; Many devices require associated units for both containment and connectivity, so I'm trying to create an attribute rule that automatically creates the object record and sets all associations on insert.&amp;nbsp; The problem arises when I attempt to add connectivity records to both terminals:&lt;/P&gt;&lt;P&gt;Electric Device:&amp;nbsp; Transformer&lt;/P&gt;&lt;P&gt;Terminals:&amp;nbsp; High Side and Low Side&lt;/P&gt;&lt;P&gt;Electric Junction Object:&amp;nbsp; Transformer Unit&lt;/P&gt;&lt;P&gt;The following code does not work - I receive an error&amp;nbsp; "Failed to create Overhead Transformer.&lt;BR /&gt;The feature and terminal specified already participate in a connectivity association. "&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;return {
"result": $feature.notes,
"edit": [
    {  
    "className" : "ElectricJunctionObject", 
    "adds" : [{
        "tag": "unit1",
        "attributes": {
            "assetgroup": 100,
            "assetType": 101}
             }]},
    {
    "className": "^UN_Association",
    "adds": [{
            "fromClass": "ElectricDevice",
            "fromGlobalId": $feature.GLOBALID,
            "toClass": "ElectricJunctionObject",
            "toGlobalId": "unit1.globalID",
            "associationType": "containment"
            }]},
    {
    "className": "^UN_Association",
    "adds": [{
            "fromClass": "ElectricDevice",
            "fromGlobalId": $feature.GLOBALID,
            "toClass": "ElectricJunctionObject",
            "toGlobalId": "unit1.globalID",
            "fromTerminal": "High Side",
            "associationType": "connectivity"
            }]},
    {//Adding this third record gives me the error stated above.
    "className": "^UN_Association",
    "adds": [{
            "fromClass": "ElectricDevice",
            "fromGlobalId": $feature.GLOBALID,
            "toClass": "ElectricJunctionObject",
            "toGlobalId": "unit1.globalID",
            "fromTerminal": "Low Side",
            "associationType": "connectivity"
            }]}
         ]
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do have success when I remove the third section (lines 32-39), so I can get one containment and one connectivity record.&lt;/P&gt;&lt;P&gt;Everything works as expected when associations are set in Pro manually.&amp;nbsp; Does anyone have advice on how to add the object to both terminals of the device?&amp;nbsp; Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 18:00:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-add-an-object-record-to-both/m-p/1384062#M1298</guid>
      <dc:creator>VanCityUtility</dc:creator>
      <dc:date>2024-02-19T18:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to add an Object record to both terminals of a device</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-add-an-object-record-to-both/m-p/1384067#M1299</link>
      <description>&lt;P&gt;Thanks I can reproduce it looks like a bug when the association is being added in multiple payloads, we will take a look.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Meanwhile the workaround is to group all associations in one payload.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;return { 
"edit": [
    {  
    "className" : "ElectricDistributionJunctionObject", 
    "adds" : [{
        "tag": "unit1",
        "attributes": {
            "assetgroup": 2,
            "assetType": 1}
             }]},
    {
    "className": "^UN_Association",
 
    "adds": [{
            "fromClass": "ElectricDistributionJunctionObject",
            "fromGlobalId": $feature.GLOBALID,
            "toClass": "ElectricDistributionJunctionObject",
            "toGlobalId": "unit1.globalID",
            "associationType": "containment"
            },
{
            "fromClass": "ElectricDistributionJunctionObject",
            "fromGlobalId": $feature.GLOBALID,
            "toClass": "ElectricDistributionJunctionObject",
            "toGlobalId": "unit1.globalID",
            "fromTerminal": "Source",
            "associationType": "connectivity"
            },
{
            "fromClass": "ElectricDistributionJunctionObject",
            "fromGlobalId": $feature.GLOBALID,
            "toClass": "ElectricDistributionJunctionObject",
            "toGlobalId": "unit1.globalID",
            "fromTerminal": "Load",
            "associationType": "connectivity"
            }
]},
   
         ]
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 18:25:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-add-an-object-record-to-both/m-p/1384067#M1299</guid>
      <dc:creator>HusseinNasser2</dc:creator>
      <dc:date>2024-02-19T18:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to add an Object record to both terminals of a device</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-add-an-object-record-to-both/m-p/1384084#M1300</link>
      <description>&lt;P&gt;Thank you so much for the quick response, and for providing a neat alternative that works.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 18:44:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-add-an-object-record-to-both/m-p/1384084#M1300</guid>
      <dc:creator>VanCityUtility</dc:creator>
      <dc:date>2024-02-19T18:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to add an Object record to both terminals of a device</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-add-an-object-record-to-both/m-p/1621022#M1774</link>
      <description>&lt;P&gt;post moved down&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 22:44:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-add-an-object-record-to-both/m-p/1621022#M1774</guid>
      <dc:creator>Joel_EWEB</dc:creator>
      <dc:date>2025-06-04T22:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to add an Object record to both terminals of a device</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-add-an-object-record-to-both/m-p/1621023#M1775</link>
      <description>&lt;P&gt;Hello Hussein,&lt;/P&gt;&lt;P&gt;I have a very simple scenario where I am creating a ServicePoint with a template so the ServicePoint will already contain a single ElectricJunctionObject:meter. I would also like to connect the&amp;nbsp;ServicePoint to the same meter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My main question is about sequence - which fires first upon feature creation: the creation of the contained&amp;nbsp; meter and containment association &lt;STRONG&gt;or&lt;/STRONG&gt; the attribute rule?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Joel_EWEB_0-1749076047901.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/133807i4FAC3DD0F97100D8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Joel_EWEB_0-1749076047901.png" alt="Joel_EWEB_0-1749076047901.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I am interested in adapting this script so it only creates the&amp;nbsp;Junction - Junction Connectivity association.&amp;nbsp; I would use FeatureSetByAssociation to grab the&amp;nbsp;ElectricJunctionObject:meter GlobalId from containment (if it exists at this point) and use it in "toGlobalId": "meter.globalID" to insert connectivity.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 22:42:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-add-an-object-record-to-both/m-p/1621023#M1775</guid>
      <dc:creator>Joel_EWEB</dc:creator>
      <dc:date>2025-06-04T22:42:59Z</dc:date>
    </item>
  </channel>
</rss>

