Predicates

A Predicate is a high-level, logical test that defines the syntax for Rules.

Types of Predicates

Predicate

Description

Parameters

Child Nodes

Static

False

Always evaluates as false.

N/A

N/A

True

Always evaluates as true.

N/A

N/A

Test

Check That

A comparison between two values using a relationship and returns true or false to indicate whether the values fulfill the relationship.

The data types of values that can be used depends on the relationship.

N/A

  • Value
  • Relation
  • Value

Reference

Test for a reference between two objects.

Specify the two objects and the name of the reference between them. The Predicate is satisfied if the first object refers to the second object using the given reference.

  • Class 1
  • Name 1 (optional)
  • Ref Name
  • Class 2
  • Name 2 (optional)

N/A

Test in Range

Test that a value lies in the range between two other values.

Specify whether or not the end points of the range should be included in the comparison ( i.e. > or ≥ ).

The values can be integers, reals or strings.

  • Include Upper Endpoint
  • Include Lower Endpoint
  • Value (to test)
  • Value (range minimum)
  • Value (range maximum)

Boolean

AND

Logical AND Predicate.

Used to combine two or more other predicates (supplied as child objects) and check that they are all true.

N/A

  • Predicate 1
  • Predicate 2
  • …add with Add
  • Predicate N

NOT

Logical NOT Predicate.

Used to invert the result of another Predicate (supplied as a child object).

For example, if the child Predicate is true, this Predicate returns false and vice-versa.

N/A

  • Predicate

OR

Logical OR Predicate.

Used to combine two or more Predicates and will pass if any of them are true.

N/A

  • Predicate 1
  • Predicate 2
  • … add with Add
  • Predicate N

XOR

Logical XOR Predicate.

Used to combine two or more Predicates and will pass if at least one of them (but not all of them) are true.

N/A

  • Predicate 1
  • Predicate 2
  • ... add with Add
  • Predicate N

Branch

Execute then Check

Execute the operation, then check the predicate.

N/A

  • Predicate

  • Operation

If…Then…Else

This must have two or three child Predicates.

The first Predicate is checked and if it holds then the overall result is the result of checking the second Predicate.

Otherwise, if the first Predicate does not hold, the overall result is the result of checking the third Predicate, or true if the third Predicate is omitted.

N/A

  • Predicate 1
  • Predicate 2
  • Predicate 3 (optional)

Try…Catch

Return the try predicate unless it throws an exception, otherwise return the catch predicate.

N/A

  • Predicate 1
  • Predicate 2

Collection

Existence in Collection

Checks whether the required number of elements exist in an object collection or an array that match the Predicate in the clause.

  • Qualifier
  • Quantity
  • Class
  • Name (optional)
  • Value (collection name)
  • Predicate

For All in Collection

Checks all objects or elements in a collection satisfy a Predicate.

The Predicate requires a value which should be an array or a collection of objects, and a Predicate to check.

For a collection of simple types, or objects of unspecified class, the class label may be omitted. Otherwise the class label specifies the type of object in the collection.

  • Class
  • Name
  • Value
  • Predicate

Loop

Chain

Check whether there is a chain of segments of the class specified between a source and a target feature.

  • Limit
  • Segment class
  • Seed name
  • Target name
  • Prior name
  • Posterior
  • Predicate

Existence

This may be used to check for the existence (or absence) of related objects satisfying a Predicate specified in a clause.

The objects in the clause are identified by the class and object label pair. You specify a qualifier ("at least", "at most", or "exactly"), a number of objects and another class name.

The Predicate checks that there exists at least one object for which the child Predicate holds.

To check for the absence of objects satisfying a Predicate, look for exactly 0 objects.

  • Qualifier
  • Quantity
  • Class
  • Name (optional)
  • Value
  • Predicate

For All

Check that all related objects satisfy some other Predicate.

This Predicate must have two child Predicates. The first Predicate finds a set of objects, the second Predicate then checks that these objects meet certain requirements.

  • Class
  • Name (optional)
  • Predicate (filter)
  • Predicate (check)

For the Nearest

For the nearest n objects, check that they satisfy another Predicate.

There can be three child elements:

  • A source geometry from which to measure distance

  • An optional Predicate, which allows additional filter Predicates on the nearest objects.

  • The Predicate to check.

  • A check is then made on the objects to see if they satisfy the second child Predicate.

    If using the optional filter, only the objects that pass the filter are tested with the second Predicate

  • Limit: The number of objects. Must be greater than 0.

  • Class

  • Alias name of the objects to loop over (optional)

  • Value (count)

  • Predicate (filter) (optional)

  • Predicate (check)

Template

Rule Template

Import a rule template.

The Template parameter allows you to choose existing Rule Templates from the dialog that appears. This only shows Rule Templates and folders that contain them.

  • Template

  • Dependent on the template