You are here: How To Guides > Defining business rules

Defining Business Rules

The Business Rule Check processor allows a set of business rules to be defined and maintained outside of OEDQ, and applied using a single processor. Rules are defined in terms of attributes, which are independent of any data structure. Attributes have tags such as a1, a2, a3 and so on, and must be mapped to the appropriate fields in the input data when the Business Rules Check processor is configured (see the Business Rules Processor topic).

The business rules can be defined:

The rest of this topic introduces the business rule format in more detail.

Business rule structure

Business rules are made up of three types of component:

 

Defining Checks

A check has the following characteristics:

A check does not specify the attribute that it will work against.

The following table describes the supported check types:

Name

Description

Options

No Data Check

Used to check that a field is blank. The check will fail if the field contains any data.

None

Population Check

Used to check that a field is not blank. The check will fail if the field does not contain any data.

None

Character Check

Used to check that data in a field contains only characters from the specified list.

Option 1 = the list of permitted characters (see Note, below), OR

Option 2 = the name of the worksheet containing the permitted characters (for use with Excel-based rules only), OR

Option 3 = the name of the reference data containing the permitted characters

Invalid Character Check

Used to check that data in a field does not contain any characters from the specified list.

Option 1 = the list of invalid characters (see Note, below), OR

Option 2 = the name of the worksheet containing the invalid characters (for use with Excel-based rules only), OR

Option 3 = the name of the reference data containing the invalid characters

Min Length Check

Used to specify a minimum length for string data in a field

Option 1 = the minimum length of the data field

Max Length Check

Used to specify a maximum length for string data in a field

Option 1 = the maximum length of the data field

List Check

Used to check that data in a field contains only values from the specified list.

Option 1 = a single permitted value, OR

Option 2 = the name of the worksheet containing the permitted values (for use with Excel-based rules only), OR

Option 3 = the name of the reference data containing the permitted values

Invalid List Check

Used to check that data in a field does not contain any values from the specified list.

Option 1 = a single invalid value, OR

Option 2 = the name of the worksheet containing the invalid values (for use with Excel-based rules only), OR

Option 3 = the name of the reference data containing the invalid values

Regex Check

Used to check that data in a field conforms to a regular expression.

Option 1 = the regular expression, OR

Option 2 = the name of the worksheet containing the regular expression (for use with Excel-based rules only), OR

Option 3 = the name of the reference data containing the regular expression

Invalid Regex Check

Used to check that data in a field does not conform to a regular expression.

Option 1 = the invalid regular expression, OR

Option 2 = the name of the worksheet containing the invalid regular expression (for use with Excel-based rules only), OR

Option 3 = the name of the reference data containing the invalid regular expression

Script

Used to specify an external script which will perform processing on the data.

Option 1 = the script code or the name of the script to be executed

Option 2 = the script language. Valid values are 'javascript' or 'groovy'. The language defaults to javascript if no option is specified.

Fail

Used to specify a check which will always fail.

None

Note: Lists of valid or invalid characters are case sensitive and can include all characters, including alphanumeric characters, whitespace characters and special characters. Where a list is supplied directly in the check, it should be entered as a single string without delimiters or whitespace characters, as these would be interpreted as part of the list itself.

Defining Conditions

Conditions associate checks with attributes. As well as associating a single check with a single attribute, a condition can apply two checks to a single attribute, or a single check to two attributes. It can also be used to aggregate other conditions together to create a more complex condition. Conditions have the following attributes:

 

The following table summarizes the behavior when two condition fields, named Condition1 and Condition2, are in use:

If Type is set to...

Then Condition1 and Condition2 contain...

And Attribute or Check contains...

If Condition1 and Condition2 are set, then...

The AND operator will cause the condition to return...

The OR operator will cause the condition to return...

Checks

A check or checks

An attribute

The two checks will both be applied to the attribute.

TRUE if and only if both conditions return TRUE for the attribute

TRUE if at least one of the conditions returns TRUE for the attribute

Attributes

An attribute or attributes

A check

The check will be applied to both attributes.

TRUE if and only if the condition returns TRUE for both attributes

TRUE if the condition returns TRUE for at least one of the attributes

Conditions

Conditions

Nothing

Both conditions will be evaluated.

TRUE if and only if both conditions return TRUE

TRUE if at least one of the conditions returns TRUE

It will readily be seen that by combining checks with different attributes and operators, and aggregating the resulting conditions together to form more complex conditions, complex logical checks can be built up.

Defining Rules

Rules are the top-level entities in the business rules check. They bring together checks and conditions, specify which attributes the checks should be applied to, and specify the error code and error message that should be raised if the rule fails. In addition, the severity of the error can be specified at this level.

Rules have the following fields:

If two checks are specified, then the rule only passes if the attribute passes both checks. That is, the result is the logical AND of both checks.

Note: Conditions can be applied to rules in order to ensure a complex set of conditions is not true. The logic describing the invalid configuration is specified using conditions. Then, a very simple rule can be created which is controlled by the condition and has Check 1 set to 'Fail'. When a rule is configured in this way, the condition will be evaluated for each row analyzed, and, if the condition is met, the rule will always fail.

Defining business rules in an Excel spreadsheet

If you wish to use an Excel Spreadsheet to define your business rules, it must conform to the following rules:

Defining business rules in reference data

If you wish to use reference data to contain your business rules, it must conform to the following rules:

Oracle ® Enterprise Data Quality Help version 9.0
Copyright © 2006,2011 Oracle and/or its affiliates. All rights reserved.