AnsweredAssumed Answered

Error 001841 The Class was not found %s  In arcade attribute rule

Question asked by jborgion Champion on Jul 28, 2020
Latest reply on Jul 29, 2020 by jborgion

More of Joe's Awesome Adventures with the Address Data  Management Solution and attribute rules...

 

I found a thread thread that mentions the same error ArcGIS PRO 2.1.3 brought new defect - ERROR 001841: The class was not found%s. Failed to execute (AssignDomainToField). from 2018.  I'm getting the same basic error when trying to validate the Centerline ID and Copy Road Aliases rule in the Address Data Management Solution that I'm trying to get to work in an EGDB environment.

 

 

The table AliasRoadName is present in the $datastore (my egdb where the centerlines reside as well.)  This rule is integral to the Split Intersecting Road Tool so if the Centerline ID and Copy Road Aliases rule doesn't work, neither will the  Split rule.  The rule that won't validate is a copy from my original proof of concept project that I got to work in a fgdb, and it worked there.

 

I'm wondering if this is just a generic error that is being returned that is meaningless for the issue at hand, but as with anything arcade, you are at the mercy of what it returns when it fails.  Below is the rule that tosses the error.  You'll notice i don't reference lines 5 & 6 further down in line line 14, opting just for the number my sequence returns. 

 

Earlier today, I posted List Database Sequences for Enterprise Geodatabase in which I question how to verify if a sequence exists in an EGDB:  I created a scratch point feature class and created a rule that calls the sequence listed below and created a point.  The sequence does in fact exist and the proper incremented sequence value populates the appropriate field in the point attribute table, so that proves to me that a sequence can be added and utilized in an egdb.

 

// This rule will create a new unique id when a road centerline is created
// This will also copy related road alias names for any roads that were added as a result of a split

// Define the leading text and the delimiter for the ID
var prefix = "MSD"
var join_char = "-"

// Define any fields to be copied from the road name aliases table (lower case)
var alias_field_names = ["roadpremod", "roadpredir", "roadpretype", "roadpretypesep", "roadname", "roadtype", "roadpostdir", "roadpostmod", "fullname", "municipality"]

// If the road was created from a split its oirginal id will have a prefix of '::'
// We will use this to find the original road and its related alias road names
if (Left($feature.UNIQUE_ID, 2) == "::" || IsEmpty($feature.UNIQUE_ID)) {
    var id = NextSequenceValue("CenterlineUniqueID")
   
    // If the UNIQUE_ID is not set return the new id
    if (IsEmpty($feature.UNIQUE_ID)) return id;
  
    // Find the original ID of the road that was split
    var original_id = Mid($feature.UNIQUE_ID, 2, Count($feature.UNIQUE_ID) - 2);
    if (IsEmpty(original_id)) return id;
   
    // Find all the related road alias names for the split road
    // Store an add for every road alias and related it to the new road that was added after the cut
    var adds = []
    var roadNameAliases = Filter(FeatureSetByName($datastore, "AliasRoadName"), "UNIQUE_ID = '" + original_id + "'");
    for (var roadNameAlias in roadNameAliases) {
        var featureAttributes = Dictionary(Text(roadNameAlias))['attributes'];
        var newAttributes = {};
        for (var k in featureAttributes) {
            if (IndexOf(alias_field_names, Lower(k)) > -1 && featureAttributes[k] != null) {
                newAttributes[k] = featureAttributes[k];
            } else {
                continue;
            }
        }
        newAttributes['UNIQUE_ID'] = id
        adds[Count(adds)] = {
            'attributes': newAttributes
        }
    }
   
    // Using the edit parameter return the list of updates and adds for the intersecting roads and a list of adds for related road alias names
    return {
        'result': id,
        'edit': [{'className': 'AliasRoadName', 'adds': adds}]
    };
}
else {
   return $feature.UNIQUE_ID
}

 

Kory Kramer

Jonathan Farmer

Chris Fox

Xander Bakker

Outcomes