You are here: Configuration > Rules > Constraint Rules

Constraint Rules


What Are They?

Constraint rules are used to let the user know which values are and are not allowed to be selected in a particular configuration. While a constraint is active, the user can not advance to commerce.

How Do They Work?

A constraint rule has a condition and an action. You can choose attribute values for the condition, which will when true, will trigger an action to be performed. Similarly, you can select action attribute(s) values that can be constrained or allowed. You can also enter a message that alerts the user that the configuration cannot have the selected set-up. The rule becomes inactive when the buyer re-selects values that are appropriate for either the action or condition attribute(s). Constraint actions can be defined as simple-action or table-based actions.

ClosedMultiple Constraint Rules on the Same Action Attribute

In the case of multiple constraints defined on the same action attribute, the rules are first ordered using the following criteria (in sequence):

  1. Descending order by product hierarchy (model-level first and all-product family level last)
  2. Descending order by number of rule inputs (rules with single-inputs fire first)
  3. Ascending order by order number

The sorted rules are then applied on after the other to display the constraint messages in sequence.

ClosedConstraints and Recommendations

Constraints and recommendations can be applied together.

Constraints are applied to all the attributes, followed by recommendations and then constraints will be run again.

The constraints are applied in two passes. The first pass to apply constraints determines the constrained action attributes to which the application of recommendations (if any) is skipped.

The recommendations are applied to only non-constrained action attributes. Constraints are run a second time to determine if any new constraints may have been triggered as a result of running the recommendations. So when the end-user makes changes to the attributes which are constrained and updates the configuration, new recommendations which were not run earlier (due to the earlier constraints) will also run which might trigger new constraints which are caught by the second pass of constraint application.

ClosedAJAX Constraint Rules

Constraint rules can run through AJAX resulting in faster performance and a dynamic user experience in configuration.

AJAX rules can be enabled for any constraint or hiding configuration rule. Unlike other rules, that are evaluated only if the attributes are set to auto update or if a user clicks the Update action, AJAX rules are evaluated and the action is performed instantly when a user changes any rule input. Input can be condition and action attributes or action inputs. AJAX rules are re-run when a user clicks the Update button.


ClosedCreating a Constraint Rule

  1. ClosedNavigate to the Supported Product Families page.

    1. Click Admin to go to the Admin Home Page.
    2. Click Catalog Definition in the Products section.

      The Supported Products page appears.

    3. Confirm that Product Families is listed in the Navigation column, and click List.

      The Supported Product Families page appears.

  1. For the Product Family for which you want to create a Constraint rule, select Constraints in the Navigation column and click List.

    The Constraint: Rules List page appears.

  1. Click Add to create a new rule.
  2. Enter the Properties of the rule.
  3. Select the Rule Conditions.
  4. Choose to apply the rule to either Configuration, Selection, or Both. Configuration is the default selection.
  5. Choose the Action Type
    1. Standard: Use the UI to add attributes to constrain or allow.
    2. Table Lookup: Select values to constrain or allow from a Data Table. See Table-Based Rules for more information
  6. Click Add Attributes to open the Action Attribute window.
  7. Select attributes from the Attributesdialog box and click Add.

  1. Select one of the following options: 
    • Select Constrain All to constrain all attribute values. Otherwise, leave it deselected and: 
    • Choose the Constraint Behavior
      1. Do not allow selected values (constrain)
      2. Only allow selected values (allow or reverse constraint)
  2. Type a message in the Static Text box or click Define BML Function to create a dynamic message.
    1. This message displays to the users only when the rule is run.
  3. Click Add and Back to save and return to the Constraint: Rules List page.

ClosedEnable AJAX

  1. Select AJAX Enabled in the Properties section of the rule.
  2. Determine if you'd like to show or hide the Processing dialog box for AJAX rules.


    This is independent of the Processing dialog box for the Update action

  3. ClosedNavigate to the Configurable Attributes Administration List page.
    1. Click Admin to go to the Admin Home Page.

    2. Click Catalog Definition in the Products section.

      The Supported Products page appears.

    3. In the Navigation column, select Configurable Attribute and then click List.

      The Configurable Attributes Administration List page appears.

  4. Enter a value for Number of Milliseconds to Wait Before Showing the Loading Dialog for AJAX Rules:

    • A positive number: Sets how must time passes before the dialog appears (in milliseconds).
    • A negative number: Disables the processing dialog for AJAX rules.
    • Zero (0): The dialog box appears instantaneously.



Related Topics Link IconSee Also