I published a weblayer where there are my UN layers and my device feature class has a attribute rules. Also there are GDB_Validation<Point/Line/Polygon>Errors and GDB_ValidationObject feature classes/table.
On device feature class there is a calculation rules in batch:
arcade code assigned to device before share weblayer
var timestart=Now()
var pointGeometry = Geometry($feature)
var fsPolygon = FeatureSetByName($datastore,"dbname.sde.classx",["*"], true)
var polygonGeometry = First (Intersects(fsPolygon, pointGeometry))
if (polygonGeometry == null) return "nessuno"
return polygonGeometry.COMUNE + ' exec.' + DateDiff(Now(),timestart,'milliseconds') + 'ms'arcade code assigned to device within weblayer (after share as weblayer)
var timestart=Now()
var pointGeometry = Geometry($feature)
var fsPolygon = FeatureSetByName($datastore,"{FA346ECC-9B15-42D9-B690-CE97B5089E03}",["*"], true)
var polygonGeometry = First (Intersects(fsPolygon, pointGeometry))
if (polygonGeometry == null) return "nessuno"
return polygonGeometry.COMUNE + ' exec.' + DateDiff(Now(),timestart,'milliseconds') + 'ms'
The Arcade code use a feature class (classx) that exist in my enterprise geodatabase (the some where there are the feature class that I used in weblayer) isn't included in the weblayer (like class1,class2, class3 example on https://community.esri.com/t5/attribute-rules-blog/attribute-rules-exclude-from-application/ba-p/101... example).
In the calculation attribute rule there are the text error and number string. I tried to use rules with "exclude from application evaluation" option and without it too.
The classx is registered as branch version and validation feature class like other feature and the weblayer has been published using version managment and validation option.
Now, when I consume within arcgis pro the weblayer and I try to add a feature within device the element is added but the field "COMUNE" is empty and no errors appear. Maybe the rule was never executed. Why the classx name has been translate in a code? Which log I can control to understand and solve this issue?
SW: Pro 3.1.1/AGS with federated Portal11.0
@gpgisandsky
Wanted add a few comments and ask some questions.
On your question "Why the classx name has been translate in a code?" this is translated to the Portal ID number for security reasons.
Also a few comments on the code. In your original code it is recommended to not use the database fully qualified dataset name for your $datastore tile. It is also recommended to specify only the fields you need instead of the '*' wildcard as well as set the get geometry to false if you are not modifying it (getting a intersect is not a modification so still works with false).
Questions, I have is have you tested the rule in a non enterprise environment such as a file geodatabase to test functionality. Testing this way can eliminate the AGE as a contributing factor.
I tested your code on my own data in a fgdb and did not see the same issue. I'm interested to know your experience with it.
~ Jake