Introduction to Business rules
Business rules can be implemented using SQL expressions.
Business rules apply to metadata
Business rules stored in meta data repository
They are used to transform data
They are usually described in natural language by business users.
Business rules specify the following
1. Mappings
2. Filters
3. Joins and
4. constraints.
1. Mapping:
It is a transformation business rule that maps source columns onto one of the target columns.
It can be executed by a relational database server at run-time.
It can also be executed by the source server (if possible), or a middle tier server or the target server.
2. Filter:
Filters applied to source data sets columns.
Only the records meets the filter condition are processed by the data flow.
3. Joins:
Joins are used to relate information in different tables. A Join condition retrieves rows from two or more
tables.
4. Constraints:
To defines the rules enforced on data sets data we need constraints.
A constraint ensures the validity of the data in a given data set
A constraint also defines the integrity of the data of a model.
Constraints can be applied to source
Constraints on the target are used to check the validity of the data before integration in the
target.
In a Data Warehouse project, these rules are defined during mapping specification document.
managers.
Business Rules usually define What to do rather than How to do it.
Examples :
1. Mapping business rule:
Sum of all amounts of items sold during May 2010 multipliedby the item price
Sql Expression:
SUM(
CASE WHEN [Link] MONTH=201110 THEN [Link] * PRODUCT.ITEM_PRICE
ELSE
0
END
)
2. Filter Business rule:
[Link]>3000
3. Join business rule:
[Link] = [Link]
4. Constraints business rule:
Unique key constraint
CONSTRAINT PK _EMP PRIMARY KEY (EMPNO)
Reference Constraint
CONSTRAINT CUSTOMER_FK
FOREIGN KEY (CUSTOMER_ID)
REFERENCES CUSTOMER(CUSTOMER_ID)