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.
However, when I extend it by another 438m the value in the Length field remains the same as the original route
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 $feature.END_M - $feature.START_M;
Solved! Go to Solution.
@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.
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.
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,
Script error: Evaluation of script expression returned not a number or infinity.”
If I see it again, I'll investigate it as a separate issue.