Task 7: Applying decision models to multi-valued variables
A decision table can process all values of a multi-valued variable by using a precondition that
iterates over each value. For example, if lens requirements contains
standard lens and super-telephoto lens, the decision table
evaluates both values sequentially.
The decision table from Task 6 includes a dedicated lens requirements column to
make decisions based on the lens type:

Task 4 introduced decomposition of complex decision logic by using intermediate decisions. This principle extends to multi-valued variables but requires extra modeling constructs.
Consider an enriched decision logic for lens model selection. A fixed-focus lens must be chosen instead of a zoom lens in these cases:
- Professional photographers who take portraits.
- Super-telephoto lenses that are used for sports photography.
The lens model decision now depends on the subject, the photographer level, the sensor format, and the lens type:

Based on this update, two columns for level and subject are
added to the decision table by using the following rules:
| Lens Type | Photographer Level | Subject | Lens Model |
|---|---|---|---|
| Standard, telephoto, wide-angle, super wide-angle | Professional | Portrait | Fixed-focus |
| Standard, telephoto, wide-angle, super wide-angle | Any | Landscape, Sports | Zoom |
| Standard, telephoto, wide-angle, super wide-angle | Beginner | Any | Zoom |
| Super-telephoto | Professional | Portrait, Sports | Fixed-focus |
| Super-telephoto | Beginner | Sports | Fixed-focus |
| Super-telephoto | Any | Landscape | Zoom |
| Super-telephoto | Beginner | Portrait, Landscape | Zoom |
This results in a 46-row decision table:

This large decision table can be decomposed by using the method from Task 4, but this requires refactoring:
- Introduce a new decision model for choosing lens models based on photographer level, subject, sensor format, and selected lens type. This submodel contains a single decision node with a decision table that has no precondition and references the selected lens type from an input data node.
- Replace the decision table with a rule that calls the submodel for each value in
lens requirements:for each lens type called 'lens type' , in 'lens requirements' add the lens-model computed from subject being subject , level being level , sensor format being 'sensor format' , lens type being 'lens type' to decision ;
It is now possible to apply the decomposition method from Task 4 in the submodel.
Exercise 1: Enhancing the main decision table
You update an existing decision table:
- Add two dependencies to the decision diagram that you built in Task 6:
- lenses must depend on level
- lenses must depend on subject
- Click the lenses decision node and open the decision table that it
contains. Then, add two condition columns for
levelandsubject. - Expand the decision table by duplicating and refining rows for different photographer levels and
subjects:
- Standard, telephoto, and wide-angle lenses
- Create four rows per sensor format:
Row Photographer Level Subject Lens Model 1 Beginner Any Zoom 2 Professional Landscape Zoom 3 Professional Sports Zoom 4 Professional Portrait Fixed-focus - Super wide-angle lenses
- Create four rows for full-frame cameras:
Row photographer level subject lens model 1 Beginner Any Zoom 2 Professional Landscape Zoom 3 Professional Sports Zoom 4 Professional Portrait Fixed-focus - Super telephoto lenses
- Create six rows for full-frame cameras (three for each photographer level):
Row photographer level subject lens model 1 Beginner Sports Fixed-focus 2 Beginner Landscape Zoom 3 Beginner Portrait Zoom 4 Professional Sports Fixed-focus 5 Professional Portrait Fixed-focus 6 Professional Landscape Zoom
The resulting decision table should contain 46 rows.
Exercise 2: Creating the lens model submodel
You create a new decision model called lens-model:
- Add four single-valued input data nodes:
level,subject,sensor format,lens type. - Add a decision node named lens of output type
lens model. - Draw links between the lens node and the four input data nodes.
- Add a decision table to the lens node:
- Create the same columns as in Exercise 1 without defining preconditions.
- Update the
lens requirementcolumn so it references thelens typenode value instead of a value that is defined by preconditions. - Update the action column to use a
set decision toconstruct instead of anaddconstruct. - Copy rows and from Exercise 1.
Exercise 3: Introducing an intermediate decision node
You refactor the decision model by introducing an intermediate decision node:
- Add a decision node named fixed focus lens of output type
Boolean. - Draw the following links:
- From fixed focus lens to subject, level, and lens type.
- From lens model to fixed focus lens.
- Remove the links between subject and lens model and level and lens model.
- Refactor the decision table to reduce complexity:
- Replace multiple columns with one: remove the
photographer levelandsubjectcolumns and add a singlefixed focus lensBoolean column. - Reduce the row count by keeping only two rows per lens type and sensor format combination:
- One row for when
fixed focus lens = true - One row for when
fixed focus lens = false
- One row for when
- Replace multiple columns with one: remove the
- Before refactoring
-
Lens Type Sensor Format Photographer Level Subject Lens Model Standard Full-frame Beginner Any Zoom 24-70 mm Standard Full-frame Professional Landscape Zoom 24-70 mm Standard Full-frame Professional Sports Zoom 24-70 mm Standard Full-frame Professional Portrait Fixed 50 mm - After refactoring
-
Lens Type Sensor Format Fixed Focus Lens Lens Model Standard Full-frame false Zoom 24-70 mm f/2.8 Standard Full-frame true Fixed 50 mm f/1.4
Exercise 4: Integrating the submodel
You adjust the decision logic of the lenses node in the main decision model:
- Add a function node to the main decision model:
- Select the decision model that you created in Task 7, Exercise 3 for the function node.
- Draw a link between the function node and the lenses node.
- Replace the existing decision logic of the lenses node with a single rule that:
- Iterates over all lens types in the
lens requirementsmulti-valued node. - Calls the submodel from Exercise 3 for each lens type.
- Passes four arguments for each invocation:
subject,level,sensor format, andlens type. - Adds the returned lens model to the multi-valued decision node.
- Iterates over all lens types in the
Lessons learned
Submodels enable:
- Complex decision logic on multi-valued nodes and variables.
- Decomposition into maintainable components.
Limitations
The main model's dependency graph currently contains two separate decision nodes that each represent part of the recommendation result. This separation can be simplified.
The final step in this tutorial demonstrates how to merge these two decision nodes into a single, unified decision node for a cleaner model architecture.