You can use step verification to confirm that the task user has edited, created, or selected the correct number of features in a step. Step verification can also check that attributes and feature geometry meet specified conditions.
Adding verification actions to a step can prevent a task from failing to run. For example, if a task uses the Merge tool to merge and attribute features, you can use step verification actions to confirm the following:
- Before the step executes the Merge tool, verify that two or more features have been selected.
- After the Merge tool completes, confirm that the merge completed successful by verifying that one feature is selected.
- For the next step, confirm that the correct attribute value has been provided for the selected feature when the step completes.
You can configure step verification actions before the step executes a command and when the step completes. See the following examples:
- Before a step executes a geoprocessing tool, step verification can check that the correct features are selected.
- Before a step completes and moves to the next step, step verification can check that the correct number of features have been created with the correct attributes.
Step verification expression types
You can use Structured Query Language (SQL) or Arcade to create step verification expressions.
Structured Query Language (SQL)
SQL expressions use combinations of operators and mathematical functions to query attributes and evaluate logical statements.
Step verification using an SQL expression queries if the number of features or records created, modified, or selected in the step meets the specified condition. For example, an SQL verification expression can query and verify that the number of features created in the step is greater than a specified number.
If the step verification expression does not meet the specified condition, an error message can be displayed and the task will not move to the next step.
Arcade
Arcade expressions use multiline scripts containing operators, mathematical functions, and spatial queries to create more complex evaluations. Arcade expressions can both query the data and also evaluate spatial and topological relationships between features. For example, an Arcade step verification expression can verify that the geometry of new features created in the step does not intersect with the geometry of other features.
Arcade verification expressions must return true or false. Expressions must return true if all the conditions in the expression were met and false if at least one condition in the expression was not met. If the step expression returns false, an error message can be displayed and the task will not move to the next step.
Arcade verification expressions use the tasks Arcade profile. An Arcade profile is a context in which an Arcade expression is evaluated and understood. An Arcade profile expects specific inputs and outputs. For example the return type of the tasks Arcade profile is always Boolean (true or false).
Benefits of using Arcade expressions
Arcade expressions have the following benefits of SQL expressions:
- Arcade expressions can query and evaluate both the attributes and spatial relationships of features.
- Arcade expressions are not stored as part of the database schema. They can be created independently from the data.
- Expressions can be more complex in the form of multiline scripts.
Add step verifications
To add step verification actions, follow these steps:
- In the Tasks pane, expand the task and choose the step you want to configure.
- Click the Actions tab in the Task Designer pane.
- Click the Add Action drop-down menu under Prior to command execution or When exiting the step and choose Verification.
Tip:
You can configure multiple verifications for a single step.
- Choose the features to verify from the Verify number of features or records in drop-down list.
Features can also be verified from a saved selection.
- Choose the attribute table of the features to be verified from the in table drop-down list.
- Choose the expression type under the Expression Type drop-down list.
You can use SQL or Arcade to create verification expressions.
- If you are using SQL, follow these substeps:
- Choose the verification condition from the meets condition drop-down list.
- Choose whether to apply a filter check on the attributes of the features by clicking Filter selection using expression.
You can use a filter expression to verify that the attributes of the features being verified meet a specified condition. For example, verify that the AssetNumber field in the selected Building Footprint features is not null.
- Type an error message to display when the verification conditions are not met under Prevent the step from proceeding and show this error message.
- Click Done to add the verification action.
- If you are using Arcade, follow these substeps:
- Use the feature class fields and Arcade functions to build an evaluation expression.
The expression must return true or false.
For example, the following Arcade expression returns true if the Name field of the feature being evaluated is not null: Return !IsEmpty($feature.Name.
- Type an error message to display when the Arcade expression returns false under Prevent the step from proceeding and show this error message.
- Click Done to add the verification action.
- Use the feature class fields and Arcade functions to build an evaluation expression.