Skip to main content

zQuoteRulesEngine Class

Zuora

zQuoteRulesEngine Class

This article describes the zQuoteRulesEngine class that is used to implement a rules engine in Zuora Quotes.

zQuoteRulesEngine Class Properties

The zQuoteRulesEngine class includes the following properties.

Property Type Description
PRICE_FIELD_DISCOUNT String Name of the discount field
PRICE_FIELD_EFFECTIVE_PRICE String Name of the effective price field
PRICE_FIELD_QUANTITY String Name of the quantity field
PRICE_FIELD_TOTAL String Name of the total field
PRODUCT_RULE_TYPE_ADDED_DISABLED String Name of the field that indicates whether Add is enabled
PRODUCT_RULE_TYPE_ADDED_ENABLED String Name of the field that indicates whether Add is disabled
PRODUCT_RULE_TYPE_REMOVED_ENABLED String Name of the field that indicates whether a product can be removed when a rule applies
UPDATABLE_FIELD_INCLUDED_UNITS String Name of the included units field

zQuoteRulesEngine.ChangeLog Class

The zQuoteRulesEngine class includes the ChangeLog class you use to record changes as product or price rules are applied during quoting.

The ChangeLog class contains the following property:

  • String description: Holds the log text.

zQuoteRulesEnginePlugin Interface

The zQuoteRulesEngine class provides the Quote Rules Engine plugin interface. Use the plugin to implement custom quoting rules on prices or products.

The plugin interface is defined as global ZQuoteRulesEngine.QuoteRulesEnginePlugin and contains the following interface methods:

  • void runPriceRules
    ​  (List<zqu.ZChargeGroup> zcgs,
       List<zqu.ZQuoteRulesEngine.ChangeLog> logs)
  • Map<String,List<String>> runProductRules
    ​  (zqu__Quote__c quote,
       List<String> ratePlanIds,
       zqu.ZQuoteRulesEngine.ChangeLog logs)
  • Boolean runValidationRules
    ​  (zqu__Quote__c quote,
       List<ZChargeGroup> zcgs,
       zqu.ZQuoteRulesEngine.ChangeLog logs)

​​See Quote Rules Engine Plugin Example for a sample rules engine plugin code.