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 using the validation service as follows:

  • Immediate evaluation
    • Immediate calculation rules
    • Constraint rules
  • Deferred evaluation
    • Batch calculation rules
    • Validation rules
Dive-in:

Edits made by the Update Subnetwork or Update Is Connected tools in a utility network may bypass geodatabase behavior and will not prompt the immediate evaluation of attribute rules. See Update subnetworks and Identify isolated features for more information.

Immediate evaluation during editing

Immediate calculation and constraint rules are automatically evaluated with edit operations such as insert, update, or delete. The specific edit operation that prompts evaluation is defined in triggering events of the rule properties. To review the rule properties, see Attribute Rules view.

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.

Immediate calculation and constraint rules have an Exclude from application evaluation option in the rule properties that affects evaluation during feature service editing. If you're editing the feature service in ArcGIS Pro, you can uncheck the Exclude from application evaluation option when you create rules, and the rules will evaluate locally before apply edit requests are sent to the server.

Note:
The Exclude from application evaluation option must be true for immediate calculation rules if the Arcade expression returns specific attribute rule dictionary keywords or uses sequences.

Deferred evaluation using the validation service

Batch calculation and validation rules are evaluated at a user-specified time using the Error Inspector or the Evaluate Rules tool. To evaluate rules using the Error Inspector or the Evaluate Rules tool, the dataset and error layers must be accessed from a web feature layer that has the validation capability enabled. Once the validation service is available, you choose when to evaluate the rules, which will review the rules for the existing set of data.

See Share datasets with attribute rules for more information.

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.

Note:
The Validation capability used to evaluate batch calculation and validation rules is only available when sharing to ArcGIS Enterprise 10.7 or later. See Considerations when sharing to older portals for more information.

Validation Status attribute

The evaluation of batch calculation and validation rules is tracked by the Validation Status field in the dataset. The Validation Status field is added when the first batch calculation or validation rule is created for the dataset. The field reports the following information for each feature:

  • Does the feature require calculation?
  • Does the feature require validation?
  • Does the feature have errors?

A feature must be set to calculation required or validation required for the evaluation to review the rules on the feature. The Validation Status field is updated when the feature is edited, during evaluation, or when a new batch calculation or validation rule is added to the dataset. When a batch calculation rule or validation rule is added to a dataset, the validation status is reset to require evaluation for all features. For example, when adding a batch calculation and validation rule to a dataset, the validation status of No calculation required, no validation required, no error is updated to Calculation required, validation required, no error.

CodeDescription

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)

Coded Value Domain of the Validation Status attribute.

Error layers

To evaluate batch calculation and validation rules with the Error Inspector, use the Add Error Layers option to add layers to your map. This adds a group layer of the error datasets from the feature service.

The error layers group layer is comprised of the following datasets:

  • GDB_ValidationPointErrors
  • GDB_ValidationLineErrors
  • GDB_ValidationPolygonErrors
  • GDB_ValidationObjectErrors

The Add Error Layers option is only available after sharing the four error datasets as part of a web feature layer that has Validation capabilities enabled. The error layers group layer is used as the source in the Error Inspector to evaluate rules and review error features.

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

Evaluate rules using the Error Inspector

You can evaluate batch calculation and validation rules using the Error Inspector in ArcGIS Pro. Before completing the steps below, the datasets and associated error datasets must be shared as a web feature layer with the Validation capability enabled. See Share datasets with attribute rules for more information.

    To evaluate rules using the Error Inspector, complete the following steps:
  1. In the Catalog pane, click the Portal tab.
  2. Locate and double-click the web feature layer containing the data to evaluate.
  3. Right-click the individual layer or layers and click Add to New > Map Add Map or Add to Current Map Add To Current Map.
  4. In the Contents pane, right-click the layer, and click Add Error Layers Group layer.

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

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

    On the Error Inspector toolbar, the Source option references the error layers in the map view.

    The Source option references the error layers in the map view.
  6. Optionally, click the Source drop-down button and choose the error layer to change the value.
  7. On the Evaluate Rules button Validate Extent, click the drop-down arrow Drop-down button to expand the options for evaluating rules.
    1. For Rule Type, choose at least one to evaluate.

      • Batch Calculation Rules
      • Validation Rules

    2. For Extent, choose one of the options.

      • Visible extent—Evaluate the visible extent of the map.
      • Full extent—Evaluate the full extent of the feature service.

    3. For Options, choose any of the following:
      • Modified in this branch—Evaluate edits made in the current branch version. This option is not available when evaluating rules using the default version.
      • Execute asynchronously—Execute the evaluate rules on the service asynchronously. This uses the system ValidationTools geoprocessing service, which allows for long-running processes.
  8. When you're finished, click the drop-down button Drop-down button to collapse the options.
  9. Click the Evaluate Rules button Validate Extent.
  10. Error features are created and displayed in the Error Inspector. To view and manage errors, see Manage attribute rule errors.