This section provides information on configuring a constraint rule using the Advanced Rule Setup. You may have created a constraint rule for a product or a product group. When you click Advanced Rule Setup on the rule creation page, the rules details page with the Conditions & Actions tab is displayed. You must configure a condition and an action to complete constraint rule creation.

Creating a Constraint Rule Condition

  1. On the Conditions & Actions tab, under the CONDITIONS section, click Add Condition.

  2. Select one of the following options from the Scope drop-down. The last column changes based on the scope you select. Enter a value name in the last column accordingly.

    OptionDescription
    Product

    This implies that the product must be present in the shopping cart to fulfil the condition.

    1. From the Scope drop-down, select Product.
    2. From the Operator drop-down, select Equals To.
    3. In the Product field, search and select a product.
    Product Family

    This implies that one or more products from the specified product family must be present in the shopping cart to fulfil the condition. The number of products that should be present depends on the Match Rule.

    1. From the Scope drop-down, select Product Family.
    2. From the Operator drop-down, select Equals To.
    3. In the Product Family field, search and select a product family.
    Product Group

    This implies that one or more products from the specified product group must be present in the shopping cart to fulfil the condition. The number of products that should be present depends on the Match Rule.

    1. From the Scope drop-down, select Product Group.
    2. From the Operator drop-down, select Equals To.
    3. In the Product Group field, search and select a product group.
    Product Field Set

    This implies that when the value of the field specified in the product scope matches the value of the field on the cart, the constraint rule condition is fulfilled. You must add at least one product field. After selecting Product Field Set on the Scope drop-down, the + Add Field button is displayed to add product fields.

    1. From the Scope drop-down, select Product Field Set.
    2. Click Add Field.
    3. Enter the following details:
      1. Product Field: Select a product field from the drop-down.
      2. Operator: Select an operator.
      3. Value: Enter the value of the product field. Each product field has one picklist value from the product object.

    You must set up the product field to have only one choice. If you update the choice later, you must also update the constraint rule condition with the product field set specification to have the correct values. Match Rule is not applied to product field set-based constraint rules. CPQ considers Match Rule as Match Any In Group by default in such cases.

    Product Option Group

    This implies that one or more products from the specified product option group must be present in the shopping cart to fulfil the condition. The number of products that must be present depends on the Match Rule.

    1. From the Scope drop-down, select Product Option Group.
    2. From the Operator drop-down, select Equals To.
    3. In the Product Option Group field, search and select an option group ID associated with the bundle.
  3. Click the Condition Criteria icon to define a constraint rule condition based on criteria. The Add Criteria pop-up is displayed. You can enter more than one criteria.
    1. On the Conditions tab, click Add Criteria and enter the following details:
      • Field: Select a field on the product.
      • Operator: Select an operator.
      • Value: Enter a value.
    2. Click Add Criteria to add more criteria.
    3. Click the Remove icon to delete a criteria.
    4. Click Remove All to remove all criteria.
    5. Turn the Logic button on if you have more than one criteria and enter a value in the Logic field.
    6. On the Actions tab, define the criteria. For more information, see Creating a Constraint Rule Action.
    7. Click Save.
  4. Click the Advanced Setup icon to define advanced conditions. The Advanced Setup pop-up is displayed. You can define advanced logic if there is more than one conditions.
    1. On the Conditions tab, enter the following details:
      • Condition Name: The name is populated automatically. You can edit the name if required.
      • Match In: Select an option where the condition match must happen. Supported values are:
        • Primary Lines: Selecting this means the condition is met only when the condition products are among the primary lines (bundle or standalone) of the shopping cart.
        • Options: Selecting this means the condition is met only when the condition products are in the option line items of the shopping cart.
        • Cart Options: Selecting this means the condition is met only when the condition products are among the cart line items of the shopping cart.
        • Location: CPQ does not support this option currently.
        • RelatedLines: CPQ does not support this option currently.
      • Match Rule: Select one of the following choices.
        There is no default value, which means that the rule condition is met if any one of the products in the product scope is selected. It is treated as Min/Max with Match Min Products as 1. Match count is done before applying the criteria.
        • Match Any In Group means that the rule condition is met if any one or more of the products from the group is selected. Match Any In Group is the same as Include Min/Max with Match Min Products as 1. It is also applicable to the Product Family and Product Field Set.
        • Match All In Group means that all of the products from the group must be present in the shopping cart to meet the condition. This is applicable only to the product group and Product Family.
        • Min/Max also requires you to specify a min/max range.
          1. Min Products: Enter a value for minimum products.
          2. Max Products: Enter a value for maximum products.
    2. On the Actions tab, define the action. For more information, see Creating a Constraint Rule Action.
    3. Click Save.
  5. click Add Condition. to add more conditions.
  6. Click the Remove icon to delete a condition.
  7. Click Remove All to remove all conditions.
  8. Turn the Logic button on and enter a value in the Logic field when you add multiple conditions.

    When there is more than one condition for a constraint rule, this field defines when to consider one or more of the conditions using AND/OR association. The sequence number defined in the Condition column is used as an identifier of the condition.

    Few examples, you defined conditions with sequence numbers as 123, 4, 5, and 6. The following examples describe various condition associations:

    Condition Association Description

    (1 AND (2 OR 3))

    Either Conditions 1 and 2  or Conditions 1 and 3 must be satisfied on the cart 
    1 AND NOT 2Condition 1 is in the cart while Condition 2 is not
    1 AND NOT(2)Condition 1 is in the cart while Condition 2 is not
    1 AND 1Only Condition 1 is evaluated on the cart. If you have defined multiple conditions, CPQ does not evaluate the remaining conditions
    NOT(5 OR 6)Neither Condition 5 nor 6 are in the cart
    NOT 5 AND 6Condition 5 is not in the cart, but Condition 6 is in the Cart.

    It is recommended that you use the logical operator "AND" to display the resultant record if all the conditions separated by AND are TRUE. For instance, (1 OR 2 ) AND (3 OR 4) AND 5. If you enter an invalid condition association, an error is displayed when you save the constraint rule.

    You must set the Sequence for each condition or the Condition Association will be unreliable. Also, a constraint rule with only NOT in condition does not work. Example, NOT (1 AND 2).

    The constraint rule conditions are created. You can now define a constraint rule action.

  9. Click Save on the Conditions & Actions tab.

Creating a Constraint Rule Action

  1. On the Conditions & Actions tab, under the ACTIONS section, click Add Action.
  2. From Action Type, select one of the following:

    OptionDescription
    ExclusionEnforces exclusion of certain products from the shopping cart.
    InclusionEnforces selection of certain products as specified by the product scope specification or criteria specification in the inclusion rule.
    RecommendationProduct recommendations are displayed when the condition is met.
    ReplacementProduct replacements are suggested when the condition is met.
    ValidationDisplays the error message when the criteria conditions are met.

     
    Action Type
    selection impacts the options available for Action Intent as shown in the following table:

    Rule Type SelectedOptions Available on the Action Intent Drop-Down
    Inclusion
    • Auto Include
    • Prompt
    • Show Message
    • Check on Finalization
    Exclusion
    • Prompt
    • Show Message
    • Check on Finalization
    • Disable Selection
    • Hide
    Validation
    • Show Message
    • Check on Finalization
    Recommendation
    • Prompt
    • Show Message
    • Check on Finalization
    Replacement
    • Prompt
    • Show Message
    • Check on Finalization

    Constraint rules of Action Types =  Recommendation and Replacement do not support Condition Criteria and work only for the Scope.

  3. From Action Intent, select one of the following:

    OptionDescription
    Auto Include

    Adds selected products automatically. When the number of products selected by the rule action is more than the number mentioned in the Match Rule condition, auto-inclusion of products is not triggered. A message is displayed from the rule action instead.

    Note: Auto Include is not applicable when the Match Rule value is Include All.

    Prompt

    Displays a message with choices of products that you can select or remove.

    Show MessageDisplays a message.
    Check on FinalizationApplies rule action on finalization of the shopping cart.
    Disable SelectionDisables selection of excluded products.
    Hide

    Hides the selection of excluded products.

  4. Select one of the following options from the Scope drop-down. The last column changes based on the scope you select. Enter a value name in the last column accordingly.

    OptionDescription
    Product
    1. From the Scope drop-down, select Product.
    2. In the Product field, search and select a product to be included or excluded.
    Product Family
    1. From the Scope drop-down, select Product Family.
    2. In the Product Family field, search and select a product family to be included or excluded. One or more of the products from the product family will be included or excluded based on rule type and match rule specifications.
    Product Group
    1. From the Scope drop-down, select Product Group.
    2. In the Product Group field, search and select a product group to be included or excluded. One or more of the products from the product group will be included or excluded based on rule type and match rule specifications.
    Action Criteria

    Click Edit Action Criteria or the Condition Criteria icon to define a constraint rule action.

    The condition criteria icon shows up when the Action Type is set to Validation.

  5. Click the Condition Criteria icon to define a constraint rule action based on criteria. The Add Criteria pop-up is displayed. You can enter more than one criteria.
    1. On the Actions tab, click Add Criteria and enter the following details:
      • Field: Select a field on the product.
      • Operator: Select an operator.
      • Value: Enter a value.
    2. Click Add Criteria to add more criteria.
    3. Turn the Logic button on if you have more than one criteria and enter a value in the Logic field.
    4. Click Save.
  6. Click the Advanced Setup icon to define advanced actions. The Advanced Setup pop-up is displayed.
    1. On the Conditions tab, update the conditions if required.
    2. On the Actions tab, enter the following details:
      1. Action Name: The name is populated automatically. You can edit the name if required.
      2. Match In: Select an option where the action match must happen. Supported values are:
        • Primary Lines: Select this option to include or exclude the products that are primary line items (offering) based on your Action Type selection.
        • Options: Select this option to include or exclude the products that are options based on your Action Type selection.
        • Cart Options: Select this option to include or exclude the products that are cart line items based on your Action Type selection.
      3. Match Rule: Applies to inclusion and exclusion type rule action only, and that has product scope as Product Family, Product Group, or Action Criteria. Select any one of the following to complete the rule action:
        • None: No product selection is allowed.
        • For inclusion type constraint rule:
          • Include Any: Allows selection of up to one product. Rest of the products in the prompt are disabled.
          • Include All: Allows selection of all products within the Product Group or Product Family. Note: Only this match rule works with Action Intent Auto Include.
          • Include Min/Max: Requires a minimum number of products specified in the Min Products field.
        • For exclusion type constraint rule:
          • Exclude All: All the products are excluded.
          • Exclude After One: Allows selection of only one product. Any other selection will trigger the rule action.
          • Exclude After Max: Allows selection of a maximum number of products specified in the Max Products field. Any other selection over and above the specified number will trigger the rule action.
      4. Message Type: Select one of the following values:
        • Error: If you select Error, you cannot finalize the cart unless you satisfy the constraint rule 
        • Warning: If you select Warning, you can finalize the cart but the warning message is displayed on the cart until you satisfy the constraint rule.
      5. Message Details: Enter text to be displayed when the rule action is effective. These messages can also be translated into multiple languages. For inclusion and exclusion type rule actions product name substitution parameters {0}, {1} can be used. For example: {0} requires {1}. For validation type rule actions only {0} will be substituted by triggering products.
      6. Click Save.
    3. Click Save on the Conditions & Actions tab.