Rule Sets
Extracted fields are evaluated according to rules. Each set of rules is a target profile that is used if a match is found. Only the profile of the first matching rule set is used. You can rank rule sets to control the order in which they are tested if multiple matches are found. Higher ranked rule sets are executed first.
- If
pathRegex
is specified, check whether the path matches. Otherwise, continue. - If
headerRegex
is specified, check whether the header matches. Otherwise, continue. - Check whether any rules match.
If any path or header regular expression is specified, it must match a record before rules are checked.
Rule Set Configuration Properties describes the available rule set configuration properties:
Property | Description |
---|---|
responseGenerator.handlers.handlerName.ruleSets[n].pathRegex | (Optional) If this property is specified, the path in the message request is checked to see whether it matches the regular expression. |
responseGenerator.handlers.handlerName.ruleSets[n].headerRegex | (Optional) If this property is specified, the header in the message request is checked to see whether it matches the regular expression. |
responseGenerator.handlers.handlerName.ruleSets[n].rules | The rules to be compared with the message request. All specified rules must match for a rule set to be considered a match. |
A rule set can consist of zero or more rules. Each rule defines the JSON path to check, the values to compare with it, and the operation to be performed if a match is found.
Rule Configuration Properties describes the available properties for configuring rules:
Property | Description |
---|---|
responseGenerator.handlers.handlerName.ruleSets[x].rules[y].jsonPath | The JSON path to check. |
responseGenerator.handlers.handlerName.ruleSets[x].rules[y].operation | The operation used to compare the field value with the configured value(s). This must be one of the operation names as described in Operations. |
responseGenerator.handlers.handlerName.ruleSets[x].rules[y].value | The value to compare the field value to for this rule. This property and the
responseGenerator.handlers.handlerName.ruleSets[x].rules[y].values property are mutually
exclusive. |
responseGenerator.handlers.handlerName.ruleSets[x].rules[y].values | The values to compare the field value to for this rule. This property and the
responseGenerator.handlers.handlerName.ruleSets[x].rules[y].value property are mutually
exclusive. |
Operations describes the available operations for evaluation of field values:
Operation | Description |
---|---|
EQUALS | Checks that the field value is equal to the configured value. |
NOT_EQUALS | Checks that the field value is not equal to the configured value. |
LESS_THAN | Checks that the field value is less than the configured value. The operation returns false if the field value is not numeric. |
GREATER_THAN | Checks that the field value is greater than the configured value. The operation returns false if the field value is not numeric. |
IN | Checks that the field value is equal to one of the configured values. |
NOT_IN | Checks that the field value is not equal to any of the configured values. |
REGEX | Checks that the field value matches the configured regular expression value. |
NOT_REGEX | Checks that the field value does not match the configured regular expression value. |
NOT_SET | Checks that the field value is null . |