Skip to main content

Evaluate attribute rules

After adding attribute rules to the data, the evaluation process reviews the rules on the data to ensure rules are followed. The evaluation method used depends on the rule type and properties. Immediate evaluation rules are evaluated immediately during an edit operation, while deferred evaluation rules are evaluated at a specified time as follows:

  • Immediate evaluation

    • Immediate calculation rules

    • Constraint rules

  • Deferred evaluation

    • Batch calculation rules

    • Validation rules

License:

To evaluate validation and batch calculation attribute rules for web feature layers, organization members must be assigned a license for the ArcGIS Advanced Editing user type extension (ArcGIS Enterprise 11.2 or later).

Immediate evaluation during editing

Immediate calculation and constraint rules are evaluated during an edit operation. Evaluation is controlled by the type of editing triggering event (insert, update, or delete). For update events, you can optionally specify a list of triggering fields. The editing triggering event and triggering fields are defined in the rule properties. To review the rule properties, see Create and manage attribute rules.

When you edit data in ArcGIS Pro or through a feature service, these rules are evaluated. Calculation rules either automatically populate fields or return an error message when the calculation expression fails. Constraint rules return an error message for rule violations. As edits are made, immediate calculation rules are evaluated first, followed by constraint rules. Any default values are set on features before evaluating these rules.

The following video shows an example of an immediate calculation rule triggering while making edits:

  • This video was created with ArcGIS Pro 3.2.

The following video shows an example of a constraint rule triggering while making edits:

  • This video was created with ArcGIS Pro 3.2.

Exclude from application evaluation

Immediate calculation and constraint rules have an Exclude from application evaluation option in the rule properties that affects evaluation during editing. When the Exclude from application evaluation option is disabled, the rule will evaluate locally before the apply edit request is sent to the data source, which is ArcGIS Enterprise when editing a feature service or the geodatabase when directly editing the feature class or table. ArcGIS Pro is the only application that is capable of evaluating rules locally.

If you don't want a rule to be evaluated until all your edits are made and not as each edit is made, enable this option to avoid ArcGIS Pro from evaluating rules locally.

Note:

The Exclude from application evaluation option must be true for immediate calculation rules if the ArcGIS Arcade expression returns specific attribute rule dictionary keywords, uses sequences, or when the field value is used in the calculation.

Deferred evaluation

Batch calculation and validation rules are evaluated at a user-specified time using the Error Inspector view or the Evaluate Rules tool. During evaluation, a batch calculation rule will automatically populate fields or create error features when calculation expressions fail, and a validation rule will create error features that highlight features violating rules. If both rule types are evaluated simultaneously, the batch calculation rules are evaluated first, followed by the validation rules. Error features for these rules can be reviewed through the Error Inspector view.

The following video shows an example of a validation rule triggering when Evaluate Rules is run from the Error Inspector view:

  • This video was created with ArcGIS Pro 3.2.
Note:

The input workspace for evaluating batch calculation and validation rules depends on the type of geodatabase the dataset with attribute rules is stored in:

  • File or mobile geodatabases—A geodatabase is the input workspace to evaluate.

  • Enterprise geodatabases—A feature service with the Validation capability is the input workspace to evaluate. If the same dataset is published to multiple services, be aware that the error layers and validation status attribute are shared for the default version.

Validation Status attribute

When working with batch calculation and validation rules, the Validation Status attribute is used to track if a feature is up to date, requires evaluation, or has errors.

The Validation Status field is a system-maintained field that is added when the first batch calculation or validation rule is created for the dataset. The Validation Status field is updated for a feature when the feature is edited and during evaluation. Only features that have a validation status of requires calculation or requires validation will be evaluated.

The Validation Status field reports the following information for each feature:

  • Does the feature require calculation?

  • Does the feature require validation?

  • Does the feature have errors?

The Validation Status field is assigned the Validation Status coded value domain. The codes and descriptions for this coded value domain represent the different evaluation lifecycle states of a feature.

Code

Description

0

No calculation required, no validation required, no error

1

No calculation required, no validation required, has error(s)

2

No calculation required, validation required, no error

3

No calculation required, validation required, has error(s)

4

Calculation required, no validation required, no error

5

Calculation required, no validation required, has error(s)

6

Calculation required, validation required, no error

7

Calculation required, validation required, has error(s)

Validation Status coded value domain

See the following example workflow to review how the Validation Status attribute changes for features:

The Inspections feature class has a single validation rule to ensure that the CompletionDate field is populated.

  1. A validation rule is created for the Inspections feature class. All rows have a Validation Status value of:

    2 - No calculation required, validation required, no error.

  2. The Evaluate Rules tool is ran on the feature class. The validation status is updated for the features:

    • Features that satisfy the rule by having a value for CompletionDate, have their validation status value updated to:

      0 - No calculation required, no validation required, no error.

    • Features that violate the rule by not having a CompletionDate populated, have their validation status value updated to:

      1 - No calculation required, no validation required, has error(s).

  3. Edits are made to record valid CompletionDate values for the features with errors. The validation status value is updated to:

    3 - No calculation required, validation required, has error(s).

  4. The Evaluate Rules tool is re-ran on the feature class. The validation status for the features that previously had errors is updated to:

    0 - No calculation required, no validation required, no error.

When a batch calculation or validation attribute rule is added, modified, or deleted for a dataset, the Validation Status attribute is updated for all features.

See the following examples:

  • When adding only validation rules to a dataset, the validation status is updated for all features:

    • 2 - No calculation required, validation required, no error
  • When adding only batch calculation rules to a dataset, the validation status is updated for all features:

    • 4 - Calculation required, no validation required, no error
  • When adding a batch calculation and validation rule to a dataset, the validation status is updated for all features:

    • 6 - Calculation required, validation required, no error
  • When all batch calculation and validation rules are deleted on a dataset, the validation status is updated for all features:

    • 0 - No calculation required, no validation required, no error
Note:

The Validation Status attribute is reset for all features in the destination dataset when copying data that contains batch calculation or validation attribute rules to another location.

Error layers

To evaluate batch calculation and validation rules with the Error Inspector, the map must contain the attribute rule dataset as a layer and the error datasets as a group layer. The error layers group layer is used as the source in the Error Inspector to evaluate rules and review error features.

To add the error datasets to the map as a group layer, right-click an attribute rule layer in the Contents pane, and select the Add Error Layers context menu option.

The Error Layers group layer is composed of the following datasets:

  • Point Errors (GDB_ValidationPointErrors)

  • Line Errors (GDB_ValidationLineErrors)

  • Polygon Errors (GDB_ValidationPolygonErrors)

  • Object Errors (GDB_ValidationObjectErrors)

Dive in:

The error datasets are created when the first batch calculation or validation rule is created in a geodatabase. These datasets are used to store all errors created during rule evaluation.

The following apply to error datasets:

  • By default the error tables are created with ObjectID and FeatureObjectID as 32-bit.

  • The error datasets that store the spatial errors are created with the WGS84 spatial reference.

  • All error datasets must have the same bit level (32 bit or 64 bit) for the ObjectID field.

  • When evaluating attribute rules on datasets with a 64-bit ObjectID, you must migrate the error datasets when the ObjectID values exceed the 32-bit range. To migrate the error tables to 64-bit run the Migrate Object ID To 64 Bit geoprocessing tool. Upgrading the error tables will upgrade the minimum client that can open the error tables to ArcGIS Pro 3.2 / ArcGIS Enterprise 11.2.

Evaluate rules using the Error Inspector

You can evaluate batch calculation and validation rules using the Error Inspector in ArcGIS Pro. The data source for the Error Inspector must be the error layers from a geodatabase or a feature service with the Validation capability.

To evaluate rules using the Error Inspector, complete the following steps:

  1. On the Insert tab, in the Project group, click New Map .

  2. On the Map tab, in the Layer group, click Add Data, browse to the data source, select the feature classes or tables to evaluate, and click OK.

    • For data shared as a feature service with the Validation capability, the data source is under Portal . Learn more about publishing datasets with attribute rules.

    • For data in a geodatabase, the data source is under Project or Computer.

  3. In the Contents pane, right-click the layer, and click Add Error Layers .

    The associated error layers are added as a single group layer, which will be used to evaluate rules in the Error Inspector.

  4. On the Edit tab, in the Manage Edits group, click Error Inspector .

    The Error Inspector pane appears, and the Source option on the Error Inspector toolbar references the error layers in the map view.

    The Source option references the error layers in the map view.

  5. Optionally, click the Source drop-down button, and choose the error layer to change the value.

  6. Click the drop-down arrow on the Evaluate Rules button to expand the options for evaluating rules.

    1. For Rule Type, choose at least one rule type to evaluate from the following:

      • Batch Calculation Rules

      • Validation Rules

    2. For Extent, choose one of the following:

      • Visible extent—Evaluate the visible extent of the map.

      • Full extent—If the source is a feature service, evaluate the full extent of the feature service. If the source is a geodatabase, evaluate the full extent of the data with attribute rules in the workspace.

    3. For Options, choose any of the following:

      • Modified in this version—Evaluate edits made in the current branch version. This option is only available when the source is a feature service with the Version Management capability and connected to a branch version. This option is not available when evaluating rules using the default version.

      • Execute asynchronously—Run the evaluate rules on the service asynchronously. This uses the system ValidationTools geoprocessing service, which allows for long-running processes. This option is only available when the source is a feature service with the Validation capability.

  7. When you're finished, click the drop-down button to collapse the options.

  8. Click the Evaluate Rules button .

Error features are created and displayed in the Error Inspector pane. To view and manage errors, see Manage attribute rule errors.