Skip to main content

CPQ X Rules Engine

Zuora

CPQ X Rules Engine

The Zuora Rules Engine enables configurable validation, dynamic pricing, and automatic addition/removal of products in the quoting process. The rules engine allows a Salesforce Administrator to easily configure quoting actions that happen automatically when certain conditions are met. 

Zuora Rules Engine is supported only with the Lightning Guided Product Selector. 

The rules engine supports the ability to:

  • Define rules trigger conditions on the Quote object.
  • Define rules trigger conditions on the parent objects of Quote, such as Account and Opportunity.
  • Define filters on the following object for rules actions:
    • Quote
    • Account
    • Opportunity
    • Quote Rate Plan
    • Quote Rate Plan Charge
    • Quote Features 
  • Add or remove products.
  • Notify the users of any invalid conditions and prevent the user from saving the selection. 
  • Adjust the core pricing fields in the Lightning Guided Product Selector based on product or quote attributes. The following pricing fields can be updated:
    • Discount
    • Effective Price
    • Total
    • Included Units
    • Quantity
    • List Price
    • Any custom fields that you configured for rules

The pricing fields are updated in the below scenarios:

  1. When user clicks the Calculate button in the Lightning Guided Product Selector.
  2. According to the Zuora Config settings, Enable Force Recalculation and Enable Real Time Rule Calculation. See Advanced Quoting Configuration Settings for details about how the settings control when the price fields are updated.

The rule actions are triggered in the order of user-defined priority.

To use rules in Zuora Quotes:

  1. Configure the rules engine in your Salesforce org
  2. Define rules.
  3. When your user goes through the product selection process in the Lightning Guided Product Selector, the rules that you defined will be triggered according to the related settings you defined in your org.

To programmatically invoke the Rules Engine from Apex code:

  1. Configure the rules engine in your Salesforce org
  2. Define rules.
  3. Add the Rules Engine class in your Apex code as described in RulesEngine Class.

Performance Guidelines

The table below presents performance testing results you can reference when configuring rules in Zuora Quotes. It will help you to estimate how Zuora Rules Engine would perform in your Zuora Quotes environment and what the upper limits are for a type of rules.

A number of factors in your Salesforce org will affect the actual execution time in your environment.

All the rules used in this testing are comprised of one Condition and one Action.

Rule Type Total # of Actions Executed 
in Under 60 Seconds
Maximum # of Actions
Before Timeout
Validation Only 2000+ 2000+
Add Product Only 150 300

Add Product Only with

the Allow Immediate Actions option

50 50*
Update Product Only 500 500

*Do not select the Allow Immediate Actions option when unnecessary as adding more than ten products at once with this option can exceed Salesforce governor limits.

Limitations

  • If you define rules trigger conditions on a Product Bundle, the rules will not be triggered on the child products.
  • If you define rules trigger conditions on a Product, the rules will not be triggered on the product ramps.