Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When using multivalued attributes as conditions in a decision table, make sure you place the conditions in the correct order. Since a decision table is evaluated by the Blueriw rule engine from left to right (see Evaluation of decision tables from left to right), a decision can have an unexpected outcome.

See the example below. This decision advises how to prepare yourself in different weather conditions, when going outside.

Image Added  When it rains, take an umbrella.
Image Added  When the wind blows, wear a coat.
Image Added  When the sun shines, there is no dresscode advice.

Image AddedImage Added  When it rains and the wind blows, the umbrella will just blow away; it is advised to wear a raincoat.
Image AddedImage Added  When the sun shines and the wind blows, wear a coat.

In the application it has been made sure that it is not possible that sunshine and rain happen simultaneously. Vicariously sunshine, rain and wind are not possible at the same time.
Although these scenarios are possible in real life, we have left them out for the sake of simplicity.

See the decision table below and ask yourself these two questions:

  1. "What will the advice be when it rains and the wind blows?"
    It should be "Wear a raincoat"
  2. "What will the advice be when the sun shines and the wind blows?"
    It should be "Wear a coat"
Image Added

When it rains and the wind blows, the advice will be to wear a coat, since the second condition alternative applies:

Image Added

When the sun shines and the wind blows, the advice will be "No dresscode" since the first condition alternative applies:

Image Added

The correct decision table is given below, where the conditions are from left to right from most complete to least complete.

Image Added

Another option might be to use two conditions, both regarding the weather. Blueriq does not prohibit us to do so. See below, where all possible combinations are visible.

Image Added

The choice between the last two decision tables (in green) is a matter of taste. Some prefer the first, some prefer the second.
A downside of the second decision table is that it is highly redundant. It is possible to make use of the fact that Blueriq evaluates decision tables from left to right to shorten the decision table a bit, as shown below, but this is not advised!

Image Added

 

 

Panel
Section
Column
width50%

Main chapter: Design considerations

Previous: Evaluation of decision tables from left to right

Column

Next: Dealing with lots of logic and multiple versions