Business rule parts and structure in the Process Designer
- definitions
- set minimum_score to 200;
- if
- the credit score of the borrower is less than minimum_score
- then
- refuse the loan with the message "Credit score below" + minimum_score;
- definitions part
- if (conditions) part
- then (actions) part
- else (optional actions) part
Definitions
The definitions part of a rule gives you more control over your business rules when you set variables at the beginning of your rule. Variables help you identify and then reference an occurrence of a business term by a convenient name. Use variables to make your business rules less ambiguous and easier to understand.
Define a variable by giving it a name of your choice and then setting a value for the variable. This value can be a number (or an arithmetic expression whose result is a number), text, or a predefined business term that already exists in your rule (for example, customer). Once you have set a variable, it becomes available in all the parts of the current rule. The variable is valid only in the rule in which it is defined.
- definitions
- set minimum_score to 200;
This is a very basic illustration of the definitions part of a rule. For more information about complex versions of the definition part, such as multiple occurrences of a value, or adding a where clause to a definition to apply further restrictions on the variables, refer to the related section in the IBM® Operational Decision Manager knowledge center, "BAL constructs -- definitions." A related link is provided.
Conditions
The condition part of a rule specifies under what conditions the actions in the action part of the rule will be carried out. Conditions are represented in the rule editor by the text (or number) that appears after if, ending at then. The word then signals the beginning of the action part of the rule.- if
- the credit score of the borrower is less than minimum_score
Actions
The action part of a rule describes what to do when the conditions of the rule are met. Actions are represented in the rule editor by the text that appears after then and else. If there is more than one action to perform, the actions are carried out in the order that they appear in the action part of the rule.true
, then the resulting action
is to refuse the loan, and issue a message "Credit score below 200."- then
- refuse the loan with the message "Credit score below" + minimum_score;
- definitions
-
set applicant to a customer
where the category of this customer is Gold; - if
- the value of the shopping cart of the applicant is more than $100
- then
- apply a 15% discount
- else
- apply a 5% discount;
set
statement, to ensure that modifications to the elements of
this list are visible after the rule is executed, you must add a dummy assignment, for
example:set applicant_list to applicant_list;