Predicates

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

Test

Predicate Description Parameter(s) Returns

Check That

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

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

N/A

  • Value
  • Relation
  • Value

Reference

Check that two objects are related via a reference e.g. a Foreign Key.

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

Check that the first value lies in the range between the second and third values.

Use the Include Upper/Lower Endpoint check boxes in the right hand panel to specify whether or not the end points of the range should be included in the comparison.

The values can be Integers, Reals or Strings.

      Example: Setting the minimum value as 5 and the maximum as 10 without selecting either endpoint option would only include 6-9 in the range.

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

Static

Predicate Description Parameter(s) Returns

Cast

The cast node allows you to assert that you know that an object will be a specific class, or that you want to pretend it is of that class. This allows you to use attributes from that class in the Rule or Action builder that would not show them otherwise.

See Cast Node for more information.

  • From Class

  • From Name (optional)

  • To Class

  • To Name (optional)

N/A

False

Always evaluates as false.

N/A

N/A

True

Always evaluates as true.

N/A

N/A

Branch

Predicate Description Parameter(s) Returns

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

Returns the Try Predicate unless it throws an exception, in which case it will return the Catch Predicate.

Useful to trap errors which would otherwise stop the object iteration or the session from continuing.

      Example: A string representing a date may not be valid when calling a function to convert it to a timestamp. Use this value to catch the error, use null instead and continue without an error.

N/A

  • Predicate 1
  • Predicate 2

Template

Predicate Description Parameter(s) Returns

Rule Template

Import a Rule Template from your Rule and Action Templates

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

Collection

Predicate Description Parameter(s) Returns

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.

A Qualifier must be set, with the options:

  • At Least: The number of elements matching the predicate must be at least equal to the quantity value.

  • At Most: The number of elements matching the predicate must be at most equal to the quantity value.

  • Exactly: The number of elements matching the predicate must be equal to the quantity value.

  • 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

Boolean

Predicate Description Parameter(s) Returns

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 icon
  • 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 icon
  • Predicate N

XOR

Logical "exclusive or" Predicate.

Takes two or more Predicates as inputs. When two are provided it will pass if one is true.

When providing more than two Predicates, it will only pass if an odd number of the conditions are true.

N/A

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

Loop

Predicate Description Parameter(s) Returns

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 can 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 at least one object exists where the child Predicate returns True.

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 filters 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.

  • Class
  • Name (optional)

 

  • Value (count)
  • Predicate (optional)
  • Predicate
  • (check)