Property Paths
Additional details regarding rule property paths
SQL Constraints in Property Paths
When defining custom properties, the path to resolve these properties can traverse through a MTM or OTM relation in one or more portions of its path. The syntax to defines these constraints is:
relation1(SQL_constraint):relation2(SQL_constraint):field
where the SQL_constraint describes some attribute of the field that uniquely identifies that object.
For example, a traversal from contact to site must go through the contact_role table.
A contact can have many contact roles, so a constraint can be used to uniquely define which role is to be used.
To define the Sys Admin role:
contact2contact_role(role_name='Sys Admin'):contact_role2site:site_name
To define the Primary Role:
contact2contact_role(primary_site=1):contact_role2site:site_name
RuleManager supports the use of constraints; however, the following operators within a constraint are NOT supported:
- is null
- is not null
- between
Property Expansion in Rule Conditions
Rules for property expansion in business rule conditions:
- The right hand side can be a literal value.
- The right hand side can be a property (indicated by wrapping in square brackets).
- The left hand side is always considered a property (which gets expanded using the path of the rule property). If the property is not found, it will be interpreted as an empty string.
For example:
Property | Operator | Value | Comments |
---|---|---|---|
Site Name | starts with | Dovetail Software | The condition evaluator will expand the property "Site Name" to its actual value, and compare it to the literal string "Dovetail Software". |
Site Name | starts with | [My Property] | The condition evaluator will expand the property "Site Name" to its actual value, then expand the property "My Property" to its actual value, and compare the two. If "My Property" is not defined as a property, then the Site Name property will be compared to the literal string "[My Property]" (including the square brackets). |
Unknown Property | starts with | foo bar | The condition evaluator will expand the property "Unknown Property" to its actual value, and compare it to the literal string "foo bar". If "Unknown Property" is not defined as a property, then it will expand to an empty string, and the empty string will be compared to the literal string "foo bar". |
Property Path Constraints
In a property, the path traverses through relations to reach the correct field for this property. The syntax for defining a property path is:
relation:relation:field
For example, the Current Owner Phone path for a case looks like:
case_owner2user:user2employee:phone
When traversing through OTM or MTM relations, the result would be multiple sets of data. In order for the property to resolve to a single piece of data, a constraint can be used. The syntax for using a constraint is:
relation(column_name operator value):field
For example:
contact2contact_role(role_name='President'):contact_role2site:site_name
The valid operators for constraints are:
- =
- <
- >
- <=
- >=
- !=
- like
- not like
The following operators are NOT supported in constraints:
- is null
- is not null
- between