|
POST
|
You need to have an exit condition, Attribute rules in this case is no different than recursive function. If you are updating object 3833, with value "Bem 3833", you might want to do a check first before doing the update. If the value is good exit the script else continue var dangleDistance = 1000;
var feature_ = $feature;
//query objectid 3833
var fs1 = Filter($featureset, "objectid = 3833 AND BEMERKUNG = 'Bem 3833'");
var f = First(fs1);
//if is null, means feature 3833 doesn't have the value Bem 3833.. contiue to update.
//if is NOT null, it means the value already there, just exist
if (f != null)
return; //quit the script
//else update the feature
return {
"result" : {
"attributes": {
"BEMERKUNG": "test 23"
}
},
"edit": [{
"className": "HydroEdgePro",
"updates": [{
"objectID": 3833,
"attributes": {
"BEMERKUNG" : "Bem 3833"
}
}]
},{
"className": "arcade_log",
"adds": [{
"attributes": {
"Value": "test"
}
}]
}]
}
... View more
11-21-2022
08:47 AM
|
0
|
0
|
2551
|
|
POST
|
When you create a feature in the geodatabase it goes into a memory buffer for performance reasons. Additional updates to the feature by its object id will go to the buffer and then finally flushed at one swoop to the database. This is what happened in your first rule, you created the feature, then asked AR to update the same feature field BEMERKUNG to "Test 2". The AR found that the feature is still in memory and updated the field in memory then flushed it to the database. So the database only saw one insert. However we can't always do this optimization. This optimization is not performed when a query against the class happens, because the query must see the feature being created (basic database semantics), so when a query happens to the class (that is your second rule where you did a count of the class), we had to flush the inserted feature to the database. Then the AR says wait a minute, we need to update the same feature (that is your return dictionary with objectId), that update actually becomes a physical second update which triggers the attribute rule again, and we go into the infinite cycle. So as a better practice, the attribute rule need to be written in a predictable way, if you want to updates fields in the same feature use the return "result" dictionary, with this we have knowledge in the AR to update the same row. Hope that clarifies it.
... View more
11-17-2022
08:52 AM
|
0
|
0
|
2571
|
|
POST
|
It seems that the feature triggers a rule that updates itself that triggers, which then retriggers the same attribute rule leading to an infinite loop and thus this error. If you want to update attributes in the same feature you can use the result keyword instead of updates. return {
"result": {
"attributes": {
"BEMERKUNG": "test 2" //this update goes to the $feature
}
},
"edit": [ {
"className": "arcade_log",
"adds": [{
"attributes": {
"Value": "test"
}
}]
}]
}
... View more
11-15-2022
08:05 AM
|
1
|
2
|
2593
|
|
POST
|
Edit: And @JohannesLindner spotted it before I did, to consume the geometry of a feature that has been queried, the featureset should be created with return geometry set to true. It is a good practice to always check for null when you call `first`, First can return null if the featureset is empty, which can cause subsequent code to fail. And just to be safe, because the error is pointing in line 18 the geometry of the line might be null here so add a check for that too. var line = first(x)
//check if line is null
if (line == null) return; //do nothing
var geom = Geometry(line)
if (is_empty(geom )) return; //check if the geometry is null Now to explain "well it worked in 2.9 why does it fail in 3.0". To validate an Arcade script , AR picks a row in the table and makes that row $feature to do the validation against. It could be the case the 2.9 gives a different row than 3.0 and resulting in a failure in your script.
... View more
10-18-2022
01:05 PM
|
1
|
1
|
1175
|
|
POST
|
As long as your rule is NOT excluded from client evaluation (there is a checkbox on the rule, leave it unchecked) and you have auto apply turn off (which is the default) then the attribute editor should not rollback the changes and will give the user the ability to fix their mistake. This means that edits are not sent to the database and processed locally in the attribute editor pane. your rule should also have return true; at the end otherwise it will always fail.
... View more
10-18-2022
08:50 AM
|
1
|
0
|
3694
|
|
POST
|
Your attribute rule is correct, the problem is the order of operations and how the relationship record is created. This is something we are trying to address. Relationships are created after attribute rules. When you add the related record, the related foreign key `.PARENTGUID` is not populated, so when the insert attribute rule gets triggered, the foreign key .PARENTGUID is null, which of course will fail to find the parent and fail the edit. Two workarounds, you can add the relationship record directly to the table and during that insert fill in the parentGUID , this will cause the Insert trigger to have the parentGuid and the rule should work. Another workaround is to make the attribute rule on update and tell users to make a physical update to the related record (update a field etc.. ) to force trigger the update attribute rule. I understand the workarounds might not be ideal, we are working on a solution not sure how long it will take though.
... View more
10-13-2022
09:43 AM
|
0
|
1
|
984
|
|
POST
|
The only way to run an attribute rule manually is to use batch calculation rule using Evaluate method. For your use case however, I think you can still use immediate calculation rule and have a special field in the class (call it trigger (true or false)) when creating a feature have the trigger default to false and only when you flip the trigger field to true the rule can execute. The rule will look something like this if ($feature.trigger == 'true') return NextSequenceValue('seq');
return; This is another way you can execute the rule manually.
... View more
10-06-2022
08:38 AM
|
3
|
1
|
4797
|
|
POST
|
Yes that would be helpful thanks. I want to know where the problem actually is and fiddler log will help (fields map might be sending incorrect request and I want to capture that), try reproducing in Pro, do the same edit there and see if you see the behavior. Try excluding from application eval too and test again in fields map ,
... View more
08-25-2022
02:13 PM
|
1
|
0
|
1956
|
|
POST
|
Hey Oliver , can you share the attribute rules with the following information? Attribute rule script: Attribute rules properties (whether its excluded from client eval, triggers etc.. ) Pro release: Server Release: SQL Server release: Dataset registration (unversioned/branch/ traditional) Fiddler logs (if Exclude from client evaluation is disabled (unchecked) ) I couldn't reproduce on my end, creating a feature with the rule succeeds on my sqlserver instance with latest software succeeds. It could be a bug in specific version of the software but hard to tell without a specific repro.
... View more
08-25-2022
01:10 PM
|
0
|
2
|
1963
|
|
POST
|
if you remove "Text" function and send native dates it works for me when the text function is there the template replacement gets confused with the data type. Let me know if that works
... View more
08-25-2022
11:20 AM
|
0
|
4
|
1981
|
|
POST
|
Here is a filegdb example which a calculation rule updates the X and Y fields with the point's geometry coordinates on insert and update. We assign the field as empty so we can update multiple fields in one shot. The rule is simple var g = Geometry($feature);
var x = g.x;
var y = g.y;
return {
"result": {
"attributes": {
"x": x,
"y": y
}
}
} the rule
... View more
08-08-2022
10:29 AM
|
1
|
0
|
3588
|
|
POST
|
Think of the dictionary you are authoring as creating an association from $feature to whatever feature you specified in the update_class. Specifying FROMTERMINAL means here you are trying to create an association from the $feature so that terminal should exist on that feature. If the terminal you are connecting to is at the device then use ToTerminal. and you can safely use the string name A blog detailing this can be found here. https://www.esri.com/arcgis-blog/products/utility-network/electric-gas/advanced-attribute-rules-creating-utility-network-associations-with-attribute-rules/ As Mike said, you can also use ^UN_Association if you want more control. (create associations between two assets other than $feature. Hope that helps
... View more
08-03-2022
04:57 PM
|
0
|
1
|
1223
|
|
POST
|
Hey Manniej, can you share the bug number? we can follow up if you are still running into this issue.
... View more
07-29-2022
04:45 PM
|
0
|
1
|
1189
|
|
POST
|
There is a known bug in 10.9.1 (can be tracked with BUG-000151193) will be addressed in 10.9.1 Geodata management Patch 2.
... View more
07-29-2022
04:42 PM
|
0
|
0
|
3690
|
|
POST
|
This is a known bug in 10.9.1 (can be tracked with BUG-000151193) will be addressed in 10.9.1 Geodata management Patch 2.
... View more
07-29-2022
04:40 PM
|
0
|
0
|
862
|
| Title | Kudos | Posted |
|---|---|---|
| 3 | 2 weeks ago | |
| 5 | 3 weeks ago | |
| 1 | a month ago | |
| 1 | 11-03-2025 12:32 PM | |
| 1 | 01-02-2025 06:31 AM |
| Online Status |
Offline
|
| Date Last Visited |
Tuesday
|