You express business policies in rules that match actions to conditions.
An action rule defines the specific actions to take when certain conditions are met. A basic action rule uses an if-then statement to associate a condition (if) with an action (then). The rule states what action to perform when a condition is true, for example:
if the credit score of ‘the borrower’ is less than 200 then in 'the loan report', reject the loan with the message "Credit score too low.";
You write an action rule as a sentence in a natural language. The rule is composed of business terms, operators, and values. In the example, the credit score of the borrower is a business term, is less than is an arithmetic operator, and 200 is a value.
Business applications call the rules to execute them, and provide data values for the business terms. In the example, the action rule must access data for the business terms the credit score of the borrower and the loan report.
To provide a complete statement, an action rule can consist of four parts: definitions, if, then, and else.
The following example shows the four parts in a rule:
definitions set applicant to a customer where the category of this customer is Gold if the value of the applicant's shopping cart is more than $100 then apply a 15% discount else apply a 5% discount
The definitions part is optional.
The if part is optional. Rules without conditions perform their actions under all circumstances.
The then part is mandatory. The rule must have at least one action.
The else part is optional. If the if part of a rule is false, and there is no else part, the rule does not execute an action.