Preconditions
About this task
Preconditions provide a way to test data to determine whether it can be checked by a decision table. If the data from an application that calls a decision table does not satisfy the preconditions of the table, the rules in the table are not executed.
You can also use preconditions to modify incoming data, and declare variables for a decision table.
definitions
set 'wealthy customer' to a customer
where the average monthly balance of this customer
is more than $1 000 000
if
the state of residence of 'wealthy customer' is NY
These preconditions start by defining the variable wealthy
customer. The preconditions then limit the scope of the rules in the decision table to
customers who have an average monthly balance of $1 million, and reside in the state of New
York.
The preconditions are tested before each rule in a table is executed. If an application presents data that passes the preconditions of a decision table, the data is tested by the preconditions before each rule in the decision table is executed. For example, if a table contains 10 rules, the preconditions can be tested 10 times.
Procedure
- In the decision table editor, click Edit preconditions.
- In the preconditions editor, press Ctrl+Spacebar. The completion menu opens. You define variables and conditions in the Preconditions section in the same way that you would create variables and conditions for a business rule in the Rule editor. See Using the rule editor for details.
- Click Define.
Results
The variables that you defined are now available for creating condition definitions in the decision table. It means that the rows of the decision table cannot be evaluated before the conditions that are defined in the precondition are satisfied.