Select to view content in your preferred language

ApplyEdits without firing immediate attribute rules and editor tracking, is it possible?

407
5
Jump to solution
07-16-2024 07:58 PM
EstherSmith_Dev
Occasional Contributor

Hi all,

I have a simple query about Attribute Rules and Editor Tracking. We have a bunch of immediate calculation attribute rules on Utility Network layers with editor tracking enabled. Attribute rules perform some data enhancements during edits made by the user in ArcGIS Pro.

We have a nightly process to perform some bulk calculations and we would like to not fire attribute rules and also not change editor tracking fields. We are using ApplyEdits REST call to perform the bulk updates. We would like attribute rules to not fire and also not change editor tracking values.

Is it possible? I would like to avoid Attribute Rule code to look for certain system user performing editing and not fire the rule if so. And it doesn't solve editor tracking problem.

I see Utility Network has UpdateSubnetwork tool that updates "SubnetworkName" field but does not fire attribute rules nor changes editor tracking values. So it must be possible somehow.

Thanks,

Vish

 

 

0 Kudos
1 Solution

Accepted Solutions
RhettZufelt
MVP Notable Contributor

Could you use python to run the arcpy.DisableEditorTracking_management and arcpy.DisableAttributeRules_management, then fire off your nightly process, then arcpy.EnableAttributeRules_management and arcpy.management.EnableEditorTracking.

This would effectively turn both off so they don't fire during the nightly process, the will re-enable them when done so that they are functioning normal again.

R_

 

View solution in original post

0 Kudos
5 Replies
RhettZufelt
MVP Notable Contributor

Could you use python to run the arcpy.DisableEditorTracking_management and arcpy.DisableAttributeRules_management, then fire off your nightly process, then arcpy.EnableAttributeRules_management and arcpy.management.EnableEditorTracking.

This would effectively turn both off so they don't fire during the nightly process, the will re-enable them when done so that they are functioning normal again.

R_

 

0 Kudos
Bud
by
Esteemed Contributor

As a last resort, you could consider running an SQL UPDATE query in the enterprise database. That wouldn't invoke editor tracking. You could use a scheduling mechanism in the database, such as Oracle Scheduler for Oracle or your database's equivalent. Or a Windows scheduled task on the GIS server running a Python script that utilizes ArcSDESQLExecute, etc. 

I'm not a DBA, I'm just aware of some functionality in the database that's often overlooked.

0 Kudos
Jake_S
by Esri Contributor
Esri Contributor

In addition to @RhettZufelt suggestion you could also implement "Controllers" to your attribute rules that prevent rules from firing. 

Some common examples are the following:

If the field value has not change, don't run the attribute rule

if($originalFeature.field == $feature.field)) {
    return
}

 

If the geometry has not changed, don't run the attribute rule

if (Equals(Geometry($originalFeature), Geometry($feature))) {
    return;
  }

 

You can string these together to control when these rules fire.

if ($editcontext.editType == "UPDATE" && Equals(Geometry($originalFeature),Geometry($feature)) && ($originalFeature.field == $feature.field)) {
  return 
}

 

Hope this helps.

~jake

Bud
by
Esteemed Contributor
  1. What kind of geodatabase is it? For example, Oracle 18c 10.7.1 enterprise geodatabase.
  2. Could you store this data in a separate table? And not enable editor tracking or attribute rules on the table?
0 Kudos