Set Text Property Rules

Jiri Hietanen
Jiri Hietanen
  • Updated

The Set Text Property Rules tool sets validation rules for the values of text properties. The rule says, for example, that each value must be one of a list of values, must start with a given text, must match a regular expression or must be unique. You can set the rule for the objects of object classes or for the objects in groups.

For example, you can check that the names of the spaces are the names in the room schedule, or that classification codes follow the format of the classification system. 

There are also other validation tools:

  • To require only that the objects have a value for a property, use the Require Properties tool. It also removes text rules.
  • To require that object classes have objects or do not have objects, use the Require Object Class tool. For groups, use the Require Object Group tool.
  • To remove the rules of all properties at once, use the Clear Validation tool.

How the values are validated

  • A property with a text rule is also required. Objects that have no value for the property fail the rule, unless Allow Empty Values is ON.
  • Each value of the property is checked against the rule, and the property fails if one of its values fails.
  • With the rules of the form 'Must ... one of the Values', for example Must start with one of the Values, a value passes when it matches at least one of the Values.
  • With the rules of the form 'Must not ... any of the Values', for example Must not start with any of the Values, a value fails when it matches any of the Values.
  • In an object class, a property with a text rule that is excluded fails.
  • The properties of an object class are validated only when the object class has included objects. The same applies to the objects in a group.

An object class or a group fails when one of its validated properties fails.

The Properties palette shows the results when it shows the objects of the object class or group: the property and each of its values get a status icon, passed or failed. Hover the mouse over the icon to see the validation message. You can read more in Properties Palette.

Properties that do not exist

You can set a rule for a property that is not in the model yet, for example a property that a later step of the dataflow adds. If an object class does not have the property, the tool keeps the rule by the name or key you gave, and reports which properties the object class does not have.

For a group, the property must be a property of every object class of the objects in the group. If it is not, the tool keeps the rule by the name or key in the same way and reports it.

The rule applies to the property as soon as a property with that name or key exists. Until then, the Properties palette shows the property as a row of its own, marked as failed, when it shows the objects of that object class or group. The value of the row is <missing> when the property does not exist. The row is shown in italics and cannot be selected.

One rule per property

A property has one rule in each object class and in each group. A new text rule replaces the earlier text rule of the property, with all its settings and values. It also replaces a requirement set with the Require Properties tool, because a property with a text rule is required anyway.

The other way round, the Require Properties tool with Is Required ON replaces the text rule with a plain requirement. To remove a text rule, use the Require Properties tool with Is Required OFF, which removes the requirement too, or the Clear Validation tool.

The rules of an object class and the rules of a group are separate. A property can, for example, have one text rule in an object class and another in a group.

Settings

Target

Defines whether the rule is set in object classes or in object groups. The default value is Object Group.

Object Class

The rule is set for the properties of all the objects of the object classes defined in the Object Class(es) setting.

Object Group

The rule is set for the properties of the objects in the groups defined in the Object Group(s) setting. The rule is for the properties of the objects, not for the properties of the group itself.

Object Class(es)

Defines the object classes for which the rule is set. This setting is available when the Target is Object Class. You can choose All, one object class or a list of object classes. The setting has no default value.

The rule is set for the object classes whether their objects are included or excluded.

If the setting is empty or does not find any object classes, the tool reports that no object classes were found and does not change the model.

With All, the rule is set for every object class. Every object class that does not have the property gets the rule for a missing property, and the Properties palette shows the property as <missing> for each of them. Select only the object classes that should have the property.

Object Group(s)

Defines the groups for which the rule is set. This setting is available when the Target is Object Group. You can select one group, several groups, or all the groups of a group category or below a parent group. Group names can contain the wildcards * and ?. The setting has no default value.

The groups must exist in the model. The rule is set for the groups whether their objects are included or excluded. A group must have objects to get the rule, because the properties are looked up in the object classes of its objects. The tool skips a group without objects and reports it.

If the setting is empty or does not find any groups, the tool reports that no groups were found and does not change the model.

Properties

Defines the names or identity keys of the properties. This setting is mandatory. If it is empty, the tool reports an error and does not change the model.

You can list several properties, and each of them gets the same rule. Type a single value directly into the box. To enter several values, click the list button at the right end of the box. The List Editor opens, where you enter one value per line. With two or more values the box shows the number of values, for example, '3 Items', and the values can then be changed only in the List Editor. The × button clears the box.

Spaces before and after the names are ignored, empty lines are skipped and a name listed twice is used once. Upper and lower case letters are not significant. Wildcards are not supported.

The tool looks for the property by its identity key first and then by its name. If an object class has several properties with the same name, for example in different property sets, the tool uses the first one it finds. Use the identity key of the property in this case.

Only text properties can have text rules. If a property is not a text property in an object class, or not a text property in every object class of the objects in a group, the tool reports a warning and does not set the rule for that property. The other properties get the rule.

Rule

Defines how the values of the properties are checked. The default value is Must be one of the Values.

Must be one of the Values

The value must be equal to one of the Values.

Must contain one of the Values

The value must contain one of the Values.

Must start with one of the Values

The value must start with one of the Values.

Must end with one of the Values

The value must end with one of the Values.

Must be like one of the Values (with wildcards)

The value must be like one of the Values, which contain wildcards. You can read more about wildcards in Using wildcards (Like -operator).

Must match one of the Values (regular expression)

The value must match one of the Values, which are regular expressions. You can read more in Using Regular Expressions.

Must have unique values

Each value can occur only once among the objects of the object class or among the objects in the group. A value that two or more objects have fails. With this rule the Values setting is not used.

Must not be any of the Values

The value must not be equal to any of the Values.

Must not contain any of the Values

The value must not contain any of the Values.

Must not start with any of the Values

The value must not start with any of the Values.

Must not end with any of the Values

The value must not end with any of the Values.

Must not be like any of the Values (with wildcards)

The value must not be like any of the Values, which contain wildcards.

Must not match any of the Values (regular expression)

The value must not match any of the Values, which are regular expressions.

Case Sensitive

If ON, upper and lower case letters are different when the values are compared. For example, the value ei60 is not equal to EI60. If OFF, upper and lower case letters are treated as the same. The default value is OFF.

With Must have unique values and Case Sensitive OFF, values that differ only in upper and lower case letters count as the same value, so EI60 and ei60 both fail.

Allow Empty Values

If ON, objects that have no value for the property pass the rule. If OFF, the property fails when some of the objects have no value for it. The default value is OFF.

Values

Defines the values that the rule uses. This setting is available when the Rule is not Must have unique values, and it is mandatory then. If it is empty, the tool reports an error and does not change the model.

Type a single value directly into the box. To enter several values, click the list button at the right end of the box. The List Editor opens, where you enter one value per line. With two or more values the box shows the number of values, for example, '3 Items', and the values can then be changed only in the List Editor. The × button clears the box.

Release Notes

This tool was added in Simplebim 12.0 SR2

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.