Welcome to Zuora Product Documentation

Explore our rich library of product information

Run the rules engine using Apex

The article provides an high-level steps to invoke the Rules Engine in your Apex code.

  1. Define the master record. When the Rules Engine is run, it starts with the id of the master object.
  2. Optionally, supply a set of rules to run. If the list is not supplied, all the rules associated with the quote will be executed.
  3. Define the child objects of the master record by converting charge groups to DataObject and attaching those to the quote DataObject as children. See the second code sample below for detail.
  4. Initialize the rules engine.
  5. Execute the rules engine.
    • The rules engine can be specified to be applied to specific types of actions.

  6. Extract the changes from the master record and update them back to the quote.

See Custom Action Plugin if you want to implement custom actions in the Rules.