Select to view content in your preferred language

How to inspect attribute rule definitions on Enterprise Service?

113
6
Jump to solution
2 weeks ago
AndrewRudin1
Frequent Contributor

I am trying to troubleshoot an issue with editing data in an enterprise geodatabase through a feature service in ArcGIS Enterprise 11.3

Does anyone know if information about attribute rules on feature classes is put into a feature service when you publish a reference service to Enterprise?  And if so, where can I inspect that attribute rule definition in the service's JSON?

I'm asking because I've run into an issue where if I edit the feature class with a calculation attribute rule applied, it will work if I edit the feature class directly from Pro.  But if I make the same edit through the service referencing the feature class, the attribute rule doesn't fire.  This made me think that somehow the service is not aware of the attribute rule, so I wanted to verify.

0 Kudos
1 Solution

Accepted Solutions
MikeMillerGIS
Esri Frequent Contributor

I believe the Attribute Rules are returned in the QueryDataElement call(https://developers.arcgis.com/rest/services-reference/enterprise/query-data-elements-feature-service...)

Let us know what you find out with support

View solution in original post

0 Kudos
6 Replies
RPGIS
by MVP Regular Contributor
MVP Regular Contributor

Hi @AndrewRudin1,

I have ran into this issue several times even though we are on 10.9.1 but I would recommend checking each of the following:

  1. Check the compatibility version of your enterprise with the rule version. The rules will show you the lowest compatible version of enterprise it will work with, and if the rule is set for a higher version than your enterprise then that might be the issue.
  2. Another issue is there could be a potential bug where the syntax checks out and the edits can be applied in pro, but once it is turned into a service, then the issues arise. Check the server logs in the server manager to see what the error is. If you get the message "script error at line 0" then that is a possible sign that there is a bug.
  3. Check if "Exclude from application evaluation" is checked if it is accessing $originalfeature or some other feature or table.
0 Kudos
MikeMillerGIS
Esri Frequent Contributor

Attribute Rules always get called in the database, regardless of client.  I would start by inspecting the Service Logs on Debug Mode.

Also, how are you verifying the rule was not fired?  Did you refresh or requery the row?

When a service edit is made and that edit affects other fields or other rows, it returns a ReturnEdit payload.  ArcGIS Pro knows about this payload and makes the appropriate updates to the affected features.  Some webapps may not honor this ReturnEdit payload, so if you AR edits other fields or other features, they are not refreshed and will be out of sync with the edits from the AR, so a manual refresh is required.

0 Kudos
AndrewRudin1
Frequent Contributor

Thanks Mike.  I'm in the middle of troubleshooting with support, as the issue seems intermittent.  I'm going to be rebuilding things today and verifying as I go.  I think the rules are eventually firing after a row is saved or committed in the standalone table in my Pro project.

I have noticed this other related bug related to the service. I have a geodatabase referenced feature service that I've been publishing and republishing as I build out my schema for editing. So I've been writing attribute rule code, then publishing, testing, and republishing as needed.    Once you publish the service, and load it into a Pro map contents, you can right click a layer in the service and see the "Data Design" menu and choose "Attribute Rules".  Sometimes this will show the attribute rules on the feature class/table referenced by that layer, but sometimes it is blank...even though I know there is an attribute rule on the table.  This is what led me to think something is being dropped when the service is published.

Also, the reason I was thinking something gets published to the service is because of the "Exclude from Application Evaluation feature.  Hussein explains it pretty well in this blog article I just found this morning linked below.  In order for the client application to be able to fire attribute rules client-side it needs to know what they are...and so I assumed they are defined in the service definition REST somewhere.  Either that or somehow the service is making a special call to the geodatabase to retrieve the rules and send them to the user's Pro client at some point prior to edits being made. 

Attribute Rules - Exclude from Application Evaluat... - Esri Community

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

I believe the Attribute Rules are returned in the QueryDataElement call(https://developers.arcgis.com/rest/services-reference/enterprise/query-data-elements-feature-service...)

Let us know what you find out with support

0 Kudos
AndrewRudin1
Frequent Contributor

Thank you Mike. That  QueryDataElement REST endpoint does indeed return details about attribute rules for the underlying data.  I can see the attribute rules being returned from some of my testing services where the attribute rules do appear in Pro when inspecting the service through the data design menu.  

 

However, I also ran it against some of services where Pro is not showing the attribute rules.  For these the QueryDataElement endpoint returns this error:

{
"error": {
"code": 400,
"message": "Unable to complete operation.",
"details": [
"Parser error: Some parameters could not be recognized. "
]
}
}

So I assume that Pro is getting the same message, but now displaying it for the user.

And still going to do a few more tests, but it seems that including a query layer amongst all the other typical feature classes and geodatabase registered standalone table in the service is causing this error to occur. 

Referencing a database view (either registered with the geodatabase or not) is probably going to be the workaround for this.

 

I'll try to respond with the final results when we close the ticket. 

0 Kudos
RPGIS
by MVP Regular Contributor
MVP Regular Contributor

We ran into similar issues when trying to utilize views. The workaround we came up with is create a sql job that updates a database table referenced by the attribute rules. 

0 Kudos