ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Data Namespace / AttributeRuleDefinition Class / GetEvaluationOrder Method
Example

In This Topic
    GetEvaluationOrder Method
    In This Topic
    Gets the order in which the rule is run. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public int GetEvaluationOrder()
    Public Function GetEvaluationOrder() As Integer

    Return Value

    An integer representing the order in which the rule is to be run.
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run
    A geodatabase-related exception has occurred.
    Remarks
    Immediate calculation rules (i.e. non batch calculation rules) can specify an evaluation order. Constraint and validation do not have an evaluation order. For these rule types, the evaluation order indicates the order that the rules were added.
    Example
    Get attribute rules of a dataset
    public void GetAttributeRules(Geodatabase geodatabase, string tableName)
    {
      using (TableDefinition tableDefinition = geodatabase.GetDefinition<TableDefinition>(tableName))
      {
        // Get all attribute rule types
        IReadOnlyList<AttributeRuleDefinition> ruleDefinitions = tableDefinition.GetAttributeRules();
    
        // Iterate rule definitions
        foreach (AttributeRuleDefinition ruleDefinition in ruleDefinitions)
        {
          AttributeRuleType ruleType = ruleDefinition.GetAttributeRuleType();
          string ruleDescription = ruleDefinition.GetDescription();
          bool isAttributeFieldEditable = ruleDefinition.GetIsFieldEditable();
          string arcadeVersionToSupportRule = ruleDefinition.GetMinimumArcadeVersion();
          int ruleEvaluationOrder = ruleDefinition.GetEvaluationOrder();
          AttributeRuleTriggers triggeringEvents = ruleDefinition.GetTriggeringEvents();
          string scriptExpression = ruleDefinition.GetScriptExpression();
    
          // more properties
        }
      }
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.2 or higher.
    See Also