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 |
|
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. |
|
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. |
|
|
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 |
|
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 |
|
OR |
Logical OR Predicate. Used to combine two or more Predicates and will pass if any of them are true. |
N/A |
|
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 |
|
Branch |
|||
Execute then Check |
Execute the operation, then check the predicate. |
N/A |
|
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 |
|
Try…Catch |
Return the try predicate unless it throws an exception, otherwise return the catch predicate. |
N/A |
|
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. |
|
|
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. |
|
|
Loop |
|||
Chain |
Check whether there is a chain of segments of the class specified between a source and a target feature. |
|
|
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. |
|
|
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. |
|
|
For the Nearest |
For the nearest n objects, check that they satisfy another Predicate. There can be three child elements:
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 |
|
|
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. |
|
|