Create rule set and rules - SmartPlant Foundation - IM Update 48 - Help - Hexagon

SmartPlant Foundation Help

Language
English
Product
SmartPlant Foundation
Search by Category
Help
SmartPlant Foundation / SDx Version
10
SmartPlant Markup Plus Version
10.0 (2019)
Smart Review Version
2020 (15.0)

Validation rules verify that the data in an imported record meets the data standards specified for the target system. Each validation rule includes an error message that is recorded in a validation report when the rule returns an invalid value. You can create a validation rule set and the individual rules that will make up that set.

A rule set has already been created called AutoGeneratedRuleSet and is auto-populated with rules when items are mapped. For example, if data is mapped to a property in the target system that is scoped by an integer, then an integer rule is auto-created.

Create a rule set

You must create a rule set and create two different rules to validate that the tag name is in the correct format, and that the maximum design pressure is within the required range.

  1. Click Data Validator Administration > RuleSets and Rules.

  2. In the RuleSets pane, click Create a new Rule Set .

  3. In the Create New Rule Set dialog box, type a name and description for the rule set. You can name it Pump-RuleSet with a description of Validates the data in the Pump List.

  4. Click Save.

Create a regular expression rule to verify the format of the Name property

This rule is created to verify that the tag names are in required format: NNNN-RP-NNN or NNNN-CP-NNN, where N stands for any number between 0 to 9.

  1. Select the Pump-RuleSet.

  2. In the Rules pane, click Create a new Rule .

  3. In the Create Rule dialog box, type a name and description for the rule. You can name it CheckTagName with a description of A regular expression rule to verify the tag name is in the required format.

  4. Select Class Definition from the Schema Type options.

  5. Select Regular Expression from the Rule Type list.

  6. Type *SampleTag* in the search box and press ENTER.

  7. Select SampleTag from the Class Definition list.

  8. Type Tag name is invalid in the Validation Rule Error Message box.

    SHARED Tip This message appears in the Validation report if the rule does not pass.

  9. Select Error from the Validation Rule Severity Level list.

  10. Click Next.

  11. Type *Name* in the search box and press ENTER.

  12. Select Name from the Property Definition list.

  13. Type \d{4}-(RP|CP)-\d{3} in the Regular Expression box. This regular expression looks for tag names in the following format: 1234-RP-123, 1234-CP-123, 9999-CP-999, 1111-RP-111.

    Use the ^ and $ symbols to restrict the data that is returned: ^\d{4}-(RP|CP)-\d{3}$. Otherwise, formats like 11234-RP-123 and 1234-RP-1234 will also pass the rule.

  14. Click Next. View Summary, and check the details.

  15. Click Finish to save the validation rule.

Create a Check Value and UOM rule to verify the value of the Design_Pressure_Max property

This rule is created to verify that the value of the maximum design pressure is within the range 15 to 28.

  1. Select the Pump-RuleSet.

  2. In the Rules pane, click Create a new Rule .

  3. In the Create Rule dialog box, type a name and description for the rule. You can name it CheckDesignPressureMax with a description of A check value and UOM rule to verify that the design pressure maximum is within a required range.

  4. Select Class Definition from the Schema Type options.

  5. Select Check Value And UOM from the Rule Type list.

  6. Type *SampleTag* in the search box and press ENTER.

  7. Select SampleTag from the Class Definition list.

  8. Type Value is not within the specified range in the Validation Rule Error Message box.

  9. Select Error from the Validation Rule Severity Level list.

  10. Click Next.

  11. Type *SampleTag* in the search box and press ENTER.

  12. Select SampleTag_Design_Pressure_Max from the Property Definition list.

  13. Type 15 in the Minimum Value box.

  14. Type 28 in the Maximum Value box.

  15. Click Next. View Summary, and check the details.

  16. Click Finish to save the validation rule.