Entity property rule
Rule type – Abstract
Purpose: This is considered ‘passed’ if the check value fulfils the test condition defined by the selected Matchers. Some comparison types use a compare value.
An Entity property rule compares a check value defined by a value configuration (in the screenshot above left) with a compare value which, depending on the selectable Matchers (in the screenshot below: by default Equals), must either be explicitly defined by a second value configuration (in the screenshot above right) or is implicitly specified by the Matchers selection:
Check logic |
Check value type |
Compare value |
|
Equals |
Agreement with a compare value |
Any |
Explicit → Value configuration |
Match with list entry in the compare value |
Any |
Explicit → Value configuration |
|
Rank comparison with selectable |
Any |
Explicit → Value configuration |
|
Text comparison ►NOW◄ The value configuration for the check value must provide a String value. For a compare value that is not a String, the string image is used, which can be specific for each execution context. |
String |
Explicit → Value configuration |
|
String |
Explicit → Value configuration |
||
String |
Explicit → Value configuration |
||
Match with an entry in the compare value list |
Any |
Implicit → ‘No value’ ($null) or ‘Empty list’ ([]) |
|
Deviation from the Original entity |
Field value of an entity |
Implicit → Corresponding field value in the Original entity |
|
Special case |
|||
Custom logic that returns a Boolean value |
Any |
Not provided (can be represented via variable if necessary) |
The name of the rule refers to a typical possible use of the Entity property rule, namely the evaluation of a specific field of the given reference object, the value of which is ‘resolved’ using an Object property resolver. For this reason, the value configuration for the check value is pre-assigned by default with an Object property resolver.
However, all other Resolvers can also be used to feed input data to the test logic determined by the Matchers as a check value or compare value.
Access to the reference object in the context of the Entity property rule or one of its fields is by no means required. An Entity property rule is also the method of choice for comparing a Variable with a static value (see Static values) or for checking whether it is filled or not using the Is empty compare type.
Configuration
The reference object in the context of the Entity property rule is available for value configurations within the configuration.
After adding a new Entity property rule, it appears as shown on the right:
|
|
If there is a type reference for the reference object for the context of the Entity property rule, for example because a Check type is provided within an AND Junction ‘above’, a field can be selected immediately in the Object property resolver (after expanding). In the example on the right, a ‘company account’ (see Company accounts) is expected as the reference object, so that – as the screenshot shows – the ‘Metatype’ (metaType) field is found when ‘type’ is searched for. |
|
After selecting the ‘Metatype’ (metaType) field, its data type – the Company meta type defined as a dynamic enumeration – is adopted as the type hint for the compare value because the Equals compare type provides for this. There is still no value configuration for the compare value, but in contrast to the first screenshot, the ‘+’ symbol indicates that a value resolver is proposed when the value configuration is expanded, with which a Company meta type can be selected as a static value. |
|
The screenshot on the right shows the Dynamic enumeration resolver proposed for the Company meta type based on the check value type, which returns two results in the dropdown for the entered search text ('a'). Unfortunately, the Dynamic enumeration resolver only allows a single selection. If different ‘metatypes’ are defined as acceptable with the same Entity property rule, the Equals compare type must be replaced by the In list compare type. ►NOTE◄ Alternatively, it is possible to ‘juxtapose’ several instances of the Entity property rule in an OR Junction. |
|
A change of compare type must be initiated by clicking on the menu icon within the hexagon shape: |
|
For the In list resolver, a Create list resolver is proposed for the compare value configuration, with which any number of entries can be defined. Unfortunately, the data type of the check value is not evaluated as an indication of the level of the list entries, so that the appropriate Dynamic enumeration resolver is not automatically suggested here. Instead, Any dynamic enumeration must be used to select specific values for the Company meta type enumeration. ►NOTE◄ If all selected enumeration values come from the same enumeration, this appears as a type hint for the return value of the Create list resolver (see screenshot on the right). |
|
By default, the In list compare type is considered passed if the check value is contained in the list provided as a compare value. The list therefore becomes a positive (whitelist). If the list needs to function as a negative list (blacklist) instead, the logic must be ‘reversed’:
This is made possible by the not menu item in the context menu for the Matchers selection. |
This Entity property rule exists for companies whose Company meta type is not ‘Company’ (COMPANY) or ‘Group’ (GROUP). |
►NOTE◄ Instead of reversing the logic for the Matchers, this could also have been done for the Entity property rule as a whole (see screenshot on the right). This is made possible by the ‘not’ ribbon button in the context menu for editing the rule, which can be opened by clicking on the menu icon in the top left-hand corner of the surrounding rectangle.
The screenshot on the right shows the ‘negated’ Entity property rule. The ‘!’ indicator appears as an icon at the bottom of the rectangular shape and as a prefix in front of the text in the title bar (‘!Compare...’). |
|
►NOTE◄ The screenshot on the right compares the appearance of the two variants for the negation in the context of an OR Junction (which makes no logical sense due to the redundancy).
|
|
LEGACY CONTENT ▼
An Objekt-Feld-Rege checks the return value from a value resolver with a specific Matchers.
The name of the rule refers to a typical use of the Entity property rule, namely the evaluation of a certain field of the given reference object, whose value is 'resolved' via an Object property value resolver. However, any other Resolvers within the Entity property rule can be used to feed any input data to the Matchers. Often, instead of an Object property value resolver, e.g. the Variable value resolver or an Input object (type safe) value resolver is used to check a value or an object that has no direct relationship to the reference object of the rule.
The Entity property rule is considered 'passed' if the input value meets the test condition defined by the Matchers.
Depending on the selection for the Matchers (via the
symbol), another Resolvers must be configured that defines the comparison value:
Comparison types with comparison value: Starts with, Ends with, Contains, In list, Equals, Compare with (Form designer)
Comparison types without comparison value: Is empty, Value changed, Script
Configuration
The Entity property rule only refers to the present reference object via the Resolvers used in the configuration, if any.
A value resolver for the value to be checked can be selected from the available options after clicking on the menu icon. As is common practice for defining values, a Chained resolver can also be configured here to define the input data for the rule using a sequence of value resolvers. The Typed attribute resolver selected on the right within the 'Attribute' category, must – as seen in the screenshot below – almost always be concatenated with a Object property value resolver, so that the field containing the actual value of an attribute can be accessed. |
|
In the hexagon below the placeholder for the value to be checked, a Matchers must be selected in the next step, which defines the actual 'checking rule'. For this purpose, a click on the The entry selected in the image ('not') refers to the not (Matcher), which can only be used in conjunction with one of the other comparison types. Therefore, this entry opens a submenu that lists all other comparison types again. As indicated in the example, here the rule is considered 'passed' if the text attribute 'EAN number' provides a text value, i.e. is 'not empty'.
|
|
As soon as a Matchers that uses a comparison value is selected, a second value resolver appears. Its return value at runtime provides the comparison value for the Matchers. Static values often occur in this line item, in connection with the comparison type In list possibly also as single values in a Create list value resolver, as in the example below. |
|