<?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: Apply Asset Package will not apply some attribute rules in ArcGIS Utility Network Questions</title>
    <link>https://community.esri.com/t5/arcgis-utility-network-questions/apply-asset-package-will-not-apply-some-attribute/m-p/1556619#M4501</link>
    <description>&lt;P&gt;I just sent it to you by mail.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Thu, 07 Nov 2024 22:29:06 GMT</pubDate>
    <dc:creator>PierreloupDucroix</dc:creator>
    <dc:date>2024-11-07T22:29:06Z</dc:date>
    <item>
      <title>Apply Asset Package will not apply some attribute rules</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/apply-asset-package-will-not-apply-some-attribute/m-p/1556181#M4489</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/188597"&gt;@MikeMillerGIS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When applying an asset package to Postgres 14 Enterprise 11.3, I noticed that some of my attribute rules did not apply while others did.&lt;/P&gt;&lt;P&gt;Only Constraint rules seems concerned in my case&lt;/P&gt;&lt;P&gt;Here is a sample code of a constraint rule that did apply (intended to check if a certain field has unique value if not null) :&lt;/P&gt;&lt;LI-CODE lang="python"&gt;if($feature.NDB == null){
  return True
}
else{
  var concession = $feature.CONCESSI;
  var gid = $feature.GLOBALID
  var fsBrt = Filter(FeatureSetByName($datastore, "ElectricDevice", ["GLOBALID", "ASSETGROUP", "NDB", "NSRNDB"], False), "ASSETGROUP = 10 AND CONCESSI = @concession AND GLOBALID &amp;lt;&amp;gt; @gid AND CYCLEVIE NOT IN (4,7)");
  var uniqueIds = [];
  var i = 0;
  for (var brt in fsBrt) {
    if (brt.NDB != null){
      uniqueIds[i++] = brt.NSRNDB
    }
  }
  var calcNsrNdb = concatenate($feature.NSR,'/',$feature.NDB)
  if (Includes(uniqueIds, calcNsrNdb)){
    return False
  }
  else{
    return True
  }
}&lt;/LI-CODE&gt;&lt;P&gt;And a very similar Constraint rule that will not apply :&lt;/P&gt;&lt;LI-CODE lang="python"&gt;if ($feature.NUMERO == null){
  return True
}
else{
  var assetGroup = $feature.ASSETGROUP
  var concession = $feature.CONCESSI;
  var gid = $feature.GLOBALID
  var uniqueIds = [];
  var i = 0;
  var table = "ElectricJunction"
  if (Includes([11, 12, 13, 15, 16], assetGroup)){
    table = "ElectricDevice"
  }
  if (Includes([16, 33], assetGroup)){
    var HtaNoeudfeatureDataset = Filter(FeatureSetByName($datastore, "ElectricJunction", ["GLOBALID", "NUMERO", "SIG_ID_UNIQUE"], False), "ASSETGROUP = 33 AND CONCESSI = @concession AND GLOBALID &amp;lt;&amp;gt; @gid AND CYCLEVIE NOT IN (4,7)");
    var HtaInterfeatureDataset = Filter(FeatureSetByName($datastore, "ElectricDevice", ["GLOBALID", "NUMERO", "SIG_ID_UNIQUE"], False), "ASSETGROUP = 16 AND CONCESSI = @concession AND GLOBALID &amp;lt;&amp;gt; @gid AND CYCLEVIE NOT IN (4,7)");
    for (var feature in HtaNoeudfeatureDataset) {
      if (feature.NUMERO != null){
        uniqueIds[i++] = feature.SIG_ID_UNIQUE
      }
    }
    for (var feature in HtaInterfeatureDataset) {
      if (feature.NUMERO != null){
        uniqueIds[i++] = feature.SIG_ID_UNIQUE
      }
    }
  }
  else{
    var featureDataset = Filter(FeatureSetByName($datastore, table, ["GLOBALID", "NUMERO", "SIG_ID_UNIQUE"], False), "ASSETGROUP = @assetGroup AND CONCESSI = @concession AND GLOBALID &amp;lt;&amp;gt; @gid AND CYCLEVIE NOT IN (4,7)");
    for (var feature in featureDataset) {
      if (feature.NUMERO != null){
        uniqueIds[i++] = feature.SIG_ID_UNIQUE
      }
    }
  }
  if (Includes(uniqueIds, $feature.SIG_ID_UNIQUE)){
    return False
  }
  else{
    return True
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess it may be related to the "table" variable used to manage the table used in the featureSetByName function. In general, Apply Asset Package will add geodatabase name as a prefix, like "my_gdb.ElectricJunction" but in this case it fails without any error. Apply Asset Package will end normally, but the rule will not apply.&lt;/P&gt;&lt;P&gt;Do you have any idea how to resolve this ?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 06:12:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/apply-asset-package-will-not-apply-some-attribute/m-p/1556181#M4489</guid>
      <dc:creator>PierreloupDucroix</dc:creator>
      <dc:date>2024-11-07T06:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Apply Asset Package will not apply some attribute rules</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/apply-asset-package-will-not-apply-some-attribute/m-p/1556219#M4490</link>
      <description>&lt;P&gt;In the ap_workspace folder, is there any reported in the GP log?&amp;nbsp; Can you verify the AR is in the xml file in the apworkspace folder?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 09:36:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/apply-asset-package-will-not-apply-some-attribute/m-p/1556219#M4490</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2024-11-07T09:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: Apply Asset Package will not apply some attribute rules</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/apply-asset-package-will-not-apply-some-attribute/m-p/1556522#M4499</link>
      <description>&lt;P&gt;Here is the log regarding the AR in the log file :&lt;/P&gt;&lt;P&gt;arcpy.gp.UpdateSchema(&lt;BR /&gt;"D:\\....myfolder.....\\myNetwork\\ElectricDevice",&lt;BR /&gt;"D:\\arcgispro\\creation_geodatabase\\AP_Workspace4\\xml\\ElectricDevice_2_EditorTracking-AttributeRules.xml",&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;EnableEditorTracking 1&lt;BR /&gt;AddAttributeRule 40&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;--&amp;gt; I have 44 AR in this feature class and in the Asset Package. 4 are missing and correspond to the code I sent you.&lt;/P&gt;&lt;P&gt;But yes, you can see here that the AR is in the AP_UN.xml file :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PierreloupDucroix_0-1731012744539.png" style="width: 548px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/119085i7C105EB2902C5D84/image-dimensions/548x404?v=v2" width="548" height="404" role="button" title="PierreloupDucroix_0-1731012744539.png" alt="PierreloupDucroix_0-1731012744539.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 20:53:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/apply-asset-package-will-not-apply-some-attribute/m-p/1556522#M4499</guid>
      <dc:creator>PierreloupDucroix</dc:creator>
      <dc:date>2024-11-07T20:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: Apply Asset Package will not apply some attribute rules</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/apply-asset-package-will-not-apply-some-attribute/m-p/1556587#M4500</link>
      <description>&lt;P&gt;If they are in the file, we are sending them to the GDB. If the gdb is failing to add them and not report an error, that is an issue.&amp;nbsp; Any chance we can get the entire AP Workspace?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 21:51:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/apply-asset-package-will-not-apply-some-attribute/m-p/1556587#M4500</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2024-11-07T21:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Apply Asset Package will not apply some attribute rules</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/apply-asset-package-will-not-apply-some-attribute/m-p/1556619#M4501</link>
      <description>&lt;P&gt;I just sent it to you by mail.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 22:29:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/apply-asset-package-will-not-apply-some-attribute/m-p/1556619#M4501</guid>
      <dc:creator>PierreloupDucroix</dc:creator>
      <dc:date>2024-11-07T22:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Apply Asset Package will not apply some attribute rules</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/apply-asset-package-will-not-apply-some-attribute/m-p/1559995#M4550</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/188597"&gt;@MikeMillerGIS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I finally turn this :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var table = "main.ElectricJunction"
if (Includes([11, 12, 13, 15, 16], assetGroup)){
  table = "main.ElectricDevice"
}
var featureDataset = Filter(FeatureSetByName($datastore, table, ["GLOBALID", "NUMERO", "SIG_ID_UNIQUE"], False), "ASSETGROUP = @assetGroup AND CONCESSI = @concession AND GLOBALID &amp;lt;&amp;gt; @gid AND CYCLEVIE NOT IN (4,7)");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;into this :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if (Includes([11, 12, 13, 15, 16], assetGroup)){
      var featureDataset = Filter(FeatureSetByName($datastore, "main.ElectricJunction", ["GLOBALID", "NUMERO", "SIG_ID_UNIQUE"], False), "ASSETGROUP = @assetGroup AND CONCESSI = @concession AND GLOBALID &amp;lt;&amp;gt; @gid AND CYCLEVIE NOT IN (4,7)");
    }
    else{
      var featureDataset = Filter(FeatureSetByName($datastore, "main.ElectricDevice", ["GLOBALID", "NUMERO", "SIG_ID_UNIQUE"], False), "ASSETGROUP = @assetGroup AND CONCESSI = @concession AND GLOBALID &amp;lt;&amp;gt; @gid AND CYCLEVIE NOT IN (4,7)");
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is now working fine, but not sure why it was not importing with the asset package but working once applied on the UN table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2024 23:09:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/apply-asset-package-will-not-apply-some-attribute/m-p/1559995#M4550</guid>
      <dc:creator>PierreloupDucroix</dc:creator>
      <dc:date>2024-11-18T23:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Apply Asset Package will not apply some attribute rules</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/apply-asset-package-will-not-apply-some-attribute/m-p/1560022#M4551</link>
      <description>&lt;P&gt;Sorry, I must have missed your mail, been a busy few weeks.&amp;nbsp; I will try to look at it and see why the import was dropping it.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2024 01:04:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/apply-asset-package-will-not-apply-some-attribute/m-p/1560022#M4551</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2024-11-19T01:04:06Z</dc:date>
    </item>
  </channel>
</rss>

