Behaviors of filters in MDM components
You can combine several search conditions in the component tMDMInput, tMDMViewSearch or tMDMDelete to retrieve or delete data in Talend MDM.
When using multiple conditions and predicates in Talend MDM components, pay attention to the following:
-
The predicates none (default), or, and, and Not are now available for use. The other predicates are reserved for future.
- The none predicate is interpreted as and by default.
- The Not predicate is applied only to the condition on which it is defined.
- When multiple conditions are defined, the or or and predicate on the last condition is not used to combine conditions.
- The or predicate is interpreted only if it is defined on all conditions, except the last condition. Otherwise the or predicate is always interpreted as and, and all conditions are combined using the and predicate.
- The predicates are applied to the conditions according to their
sequential order. For example, if four conditions C1, C2, C3, C4 are
defined in the following
order:
C1 and C2 or C3 not C4 none
The predicates are applied to the conditions in this way (((C1 and C2) and (not C3)) and C4).
- All values need to be entered between double quotes when defining a condition.
Below are several examples of using multiple conditions and predicates in Talend MDM components.
Example 1: The following four conditions are combined and interpreted as (((C1 and C2) and C3) and C4), which returns all products whose name contains Talend and Shirt, and price is greater than 10 and is less than 20.
XPath | Operator | Value | Predicate | Condition Alias |
---|---|---|---|---|
Product/Name | Contains | "Talend" | or | C1 |
Product/Name | Contains | "Shirt" | and | C2 |
Product/Price | > | "10" | or | C3 |
Product/Price | < | "20" | none | C4 |
Example 2: The following four conditions are combined and interpreted as (((C1 and C2) and (not C3)) and C4), which returns all products whose name contains Shirt, price is greater than 15 and not equal to 15.99, and family equals 1.
XPath | Operator | Value | Predicate | Condition Alias |
---|---|---|---|---|
Product/Name | Contains | "Shirt" | or | C1 |
Product/Price | > | "15" | or | C2 |
Product/Price | = | "15.99" | not | C3 |
Product/Family | = | "1" | none | C4 |
Example 3: The following four conditions are combined and interpreted as (((C1 or C2) or C3) or C4), which returns all products whose name contains Shirt or Hat, or price is less than 10 or greater than 20.
XPath | Operator | Value | Predicate | Condition Alias |
---|---|---|---|---|
Product/Name | Contains | "Shirt" | or | C1 |
Product/Name | Contains | "Hat" | or | C2 |
Product/Price | < | "10" | or | C3 |
Product/Price | > | "20" | none | C4 |