Tips for defining scopes

When defining a constraint-based scope, you must first use two special constraints to establish a starting set of domain elements by specifying a base scope (subject is in scope) and the subject type (subject is a). Additional constraints can be added to further pare down the scope.

Starting set constraints

At minimum, all constraint-based scopes must specify a starting (base) scope and a subject type. By default, these are set to Everything and Domain Element respectively.

Subject is in scope
The starting scope or base scope. This can be a built-in scope or a scope you have defined. Nothing that is not in this scope will be included in the scope you are defining.
Subject is a
All members of the scope you are defining will be of the type you specify here.

Adding constraints

A constraint can be thought of as a requirement for membership in a scope and all top-level constraints are combined with a logical “and” operation. Therefore, constraints can never add to the starting set of domain elements.

Notes:
  1. Properties and relations - The set of properties and relations available to you when writing a constraint depends upon what subjects are defined by earlier constraints. For example, the address property applies (and is available) when the subject is a device but does not apply (and is therefore not available) when the subject is an interface.
  2. Introducing other variables - The set of properties and relations available to you when writing a constraint depends upon what subject is defined to be by earlier constraints.
  3. Nested constraints - You can combine constraints with logical or operation into a single group that is then ANDed with other top-level constraints. You can also nest constraints to any arbitrary depth alternating between AND and OR with each additional level of depth.
  4. Using wildcards in scope constraints - You can use the wildcard character "*" when specifying values in scope constraints. For example, the following scope constraint uses wildcards to match on all subjects whose bestName starts with "RS": Subject.bestName matches "RS*".