Extend Route appears to ignore Attribute Rules

1462
4
Jump to solution
11-02-2022 10:20 PM
GraemeBrowning_Aurizon
Occasional Contributor II

This is related to Realigning route confuses Attribute Rules - Esri Community and probably has the same underlying cause but I am posting it as well because it represents a simpler example.

I'm using ArcGIS Pro 3.0.2, ArcGIS Enterprise 11 and Location Referencing license that came with ArcGIS Roads and Highways.  However, the problem I describe here is also reproducible when testing using a File Geodatabase in place of ArcGIS Enterprise.

When I use Create Route it correctly populates a field named Length (and 10 other fields needed to meet business requirements) with a value of 577m using an Attribute Rule.

GraemeBrowning_Aurizon_0-1667451985353.png

 

GraemeBrowning_Aurizon_1-1667452070092.png

However, when I extend it by another 438m the value in the Length field remains the same as the original route

GraemeBrowning_Aurizon_2-1667452325617.png

 

GraemeBrowning_Aurizon_3-1667452479438.png

It looks to me like when the new (extended) route gets inserted/created, either the Attribute Rules are not being run, or they are being run and then the original values are being copied back over them.

Should my Length field be getting set by Attribute Rules when Extend Route is run?

These are the Arcade expressions I use on my Attribute Rules for START_M, END_M and Length respectively:

 

 

 

 

return Geometry($feature).paths[0][0].m;
return Geometry($feature).paths[-1][-1].m;
return $feature.END_M - $feature.START_M;

 

 

 

 

 

 

 

0 Kudos
1 Solution

Accepted Solutions
AyanPalit
Esri Regular Contributor

@GraemeBrowning_Aurizon Please confirm that the AR is triggered on INSERT and UPDATE parameters for triggering_events as in Add Attribute Rule

Ayan Palit | Principal Consultant Esri

View solution in original post

0 Kudos
4 Replies
AyanPalit
Esri Regular Contributor

@GraemeBrowning_Aurizon Please confirm that the AR is triggered on INSERT and UPDATE parameters for triggering_events as in Add Attribute Rule

Ayan Palit | Principal Consultant Esri
0 Kudos
GraemeBrowning_Aurizon
Occasional Contributor II

@AyanPalit I initially had my Attribute Rules triggered on both INSERT and UPDATE but I kept getting errors (I'll need to set that again to obtain details) so I switched to just INSERT and when the error in this thread is seen it is only INSERT that will have been in place.

I've had had trouble modifying my Attribute Rules when my LRS is in the Enterprise Geodatabase so I have been setting them on the File Geodatabase that I migrate there using an ArcPy script.

I'll try changing them to INSERT and UPDATE first through the GUI, and then through my script to see if that resolves this error.  If I encounter others by doing that I'll report them separately.

0 Kudos
GraemeBrowning_Aurizon
Occasional Contributor II

In my File Geodatabase LRS Line Network I was able to change my 11 Attribute Rules to INSERT+UPDATE using the Catalog pane, and when I ran the same test all fields updated as desired so it looks like I need to use INSERT+UPDATE from now on.

In my Enterprise Geodatabase (SQL Server) LRS Line Network I was not able to change my Attribute Rules using the Catalog pane.  I did exactly the same as for the File Geodatabase and had all the left-hand cells green prior to clicking the Save button on the Attribute Rules tab of the Ribbon but that just turned the first left-hand cell to red and did not change any of them.  No error message was seen.  I'll now recreate that Enterprise Geodatabase (SQL Server) LRS Line Network from scratch (create File Geodatabase and then migrate it) with the Attribute Rules set to INSERT+UPDATE prior to migrating it.

 

GraemeBrowning_Aurizon_0-1667949099211.png

 

0 Kudos
GraemeBrowning_Aurizon
Occasional Contributor II

I've now re-loaded my Enterprise Geodatabase and made sure that the Attribute Rules on the LRS Line Network were all INSERT and UPDATE, and Extend Route is now creating the desired route!

As an aside, the error message that led me to place suspicion on whether UPDATE should not be used came from Create Route and was:

“Unable to complete operation.
Evaluation of script expression returned not a number or infinity. [
Rule name: Update FROM_,
Triggering event: Insert,
Class name: Lrs_CQCN_TRACK_LR,
GlobalID: {B7AA3F92-27F2-4BFD-9412-7AF5BDD9A928},
Script error: Evaluation of script expression returned not a number or infinity.”

GraemeBrowning_Aurizon_0-1667962210831.png

 

If I see it again, I'll investigate it as a separate issue. 

0 Kudos