Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Validation Rules (Rules) utilize “if/then” logic (e.g., "if a tree has a broken top, a height measurement is required").  Rules implemented by creating records in a specific table named 'Rules' which is included in the feature service used by MobileMap when collecting data.  See the Data Model section below for a description of the fields in the Rules table.

  • Field relationships (Related Domains) restrict choices in one attribute field based on the values selected in a related attribute field (e.g., if Plot Type is 'Variable Radius', Plot Size options should only include variable radius plot sizes and NOT fixed area plot sizes).  Related Domains are implemented by creating records in a specific table named 'Related_Domains' which is included in the feature service used by MobileMap when collecting data.  See the Data Model section below for a description of the fields in the Rules table.

Validation

...

Rules

Examples

Rules use a very flexible format to support a wide range of validation tests.  With this flexibility, however, comes complexity.  To help understand the general format of MobileMap rules, consider the following examples that can be supported via Rules:

  1. The field 'DBH' cannot have a value greater than '40'

  2. The field 'Net Acres' cannot have a value greater than the field 'Gross Acres'

  3. If the field 'Tree Type' has a value equal to 'Overstory', then the field 'DBH' cannot have a value less than '5'

  4. If the field 'Component' has the value 'Live', then the field 'Snag Class' cannot have a value that is not equal to Null

  5. If the fields 'DBH' and 'Height' both have a value not equal to 'Null', then the field 'Tally Measure' cannot have a value equal to 'T'

  6. The field 'DBH' cannot have a value greater than '20'; If it does, warn the user but don't prevent saving the feature

Validation Rule Structure

At the hightes level, Rules are broken into 3 main parts - the criteria, comparison and the test.  If the criteria is met, then the test is applied.  In examples 1 and 2 above, there are no criteria and the tests are always applied.  The comparison phrase in all of the examples above is 'cannot have a value'. If the test passes (is true), then the validation fails due to this comparison phrase. 

...

Rule

Criteria Field

Criteria Operator

Criteria Value

Test Field

Test Operator

Test Value

Comparison

Error Type

The field 'DBH' cannot have a value greater than '40'

NA

NA

NA

DBH

>

40

!=

Error

The field 'Net Acres' cannot have a value greater than the field 'Gross Acres'

NA

NA

NA

Net Acres

>

Gross_Acres

!=

Error

If the field 'Tree Type' has a value equal to 'Overstory', then the field 'DBH' cannot have a value less than '5'

Tree_Type

=

Overstory

DBH

<

5

!=

Error

If the field 'Component' has the value 'Live', then the field 'Snag Class' cannot have a value that is not equal to Null

Component

=

Live

Snag Class

!=

Null

!=

Error

If the fields 'DBH' and 'Height' both have a value not equal to 'Null', then the field 'Tally Measure' cannot have a value equal to 'T'

DBH, Height

!=

Null

Tally_Measure

=

T

!=

Error

The field 'DBH' cannot have a value greater than '20'; If it does warn the user but don't prevent saving the feature

NA

NA

NA

DBH

>

20

!=

Warning

Managing Validation Rules

In order to assist with the mangement of Validation Rules, InventoryManager provides a dedicated interface for creating and editing validation rules.  The screenshot below shows this user interface in a typical InventoryManager implementation.  Even if your organization is not using InventoryManager to manage your MobileMap data collection, screenshot below is still helpful to explain the process and inputs for creating and editing validation rules via ArcMap, ArcGIS Online, or ArcGIS Pro.

...

The full data model for the Rules table is shown in the image below.  MB&G can provide a sample File Geodatabase with this data model upon request.

...

 

 

Testing Validation Rules

Validation rules currently only apply to MobileMap. They have not yet been implemented in InventoryManager. To test your validation rules, therefore, download them to MobileMap using the standard approach (Actions > Download). Make sure to review the download results and verify that new Rules records were downloaded. Next, collect (or edit) data using the layers for which the rules were created. For example, if a new business rule was created that is a warning for trees with DBH greater than 30”, open up a plot for editing, open up the tree list, and attempt to enter and save a tree with a DBH of 35. You should see a popup message with the error. In the case of a warning, you will still be able to save and close the tree list. All errors (and warnings) that are triggered by Validation Rules (rather than domain errors) will include the phrase ‘(business rule)’ to indicate that this error is not due to a coded value or range domain error, but rather a validation rule.

...