Product Administration Guide > Configuration Rule Template Reference >

Set Preference


The Set Preference template has the form:

When possible, constrain [an expression] to be true with a [specified priority]

The expression in a preference rule is enforced as a constraint only if it does not conflict with any other rule type or with any user selections. The purpose of the Set Preference template is to allow you to create soft constraints that guide the eConfigurator engine in producing solutions but which the engine can ignore if needed to avoid conflicts or performance problems.

A key use for preference rules is to cause a default selection of Item B based on the selection of Item A. This is called a dynamic default. You can set a default dynamically based on a previous user selection. The user can then override the default if desired by making choosing a different item than the dynamic default.

For example, you could write the following rule:

When possible, constrain [Item A requires Item B] to be true with a priority
of [0].

When the user picks Item A, the engine will attempt to create a solution containing Item B. However, the engine is free not to include Item B in order to avoid conflicts and performance problems.

If the user does not want Item B, they can remove it without creating a conflict. If you had written the rule as "Item A requires Item B", Item B would be added when the user picks Item A. If the user tries to remove Item B, they would receive a conflict message.

Another use for the Set Preference Template is to set or modify the default value for an attribute. To do this, you would write a preference rule where the expression, is Attribute A = value. The attribute would then be displayed with this value unless overridden by another rule.

The priority operand in preference rules determines the order in which multiple preference rules for an item are evaluated. Preference rules with priority 0 that apply to a specific item are evaluated first. Those with priority 1 that apply to that item are evaluated next, and so on.

For example, you have written two preference rules that apply to a specific relationship. PrefRule A has a priority of 0. PrefRule B has a priority of 1. The eConfigurator engine will attempt to add PrefRule A to the solution before attempting to add PrefRule B.

Here's how the eConfigurator engine creates solutions containing preference rules:


 Product Administration Guide, Version 7.5 
 Published: 18 April 2003