Require Rule

The require rule requires certain components to be included in a relationship when specified conditions are met.

Required components can have attributes and quantity specified. The require rule can include an optional explanation message, for the rule failure explanation.

In certain scenarios, you can independently add a type at the header level. This means you can include a specific type even if it isn't explicitly defined as part of any of the relationships you've configured. This capability offers flexibility in managing and including necessary types that might not always fall under a specific relationship structure.

If a require rule auto-adds a product that has one or more Product Selling Model Options (PSMOs), set one PSMO on the product to Default. The system uses the default PSMO to determine which pricebook entry to use for the auto-added product. For more information, see Manage Product Selling Model in Revenue Cloud in Salesforce Help.

Note

The require rule has this syntax:

1require(logic expression, relationship[type]{var=value,…,var=value}==integer value, "Explanation message");

In this example, the require rule specifies that if the number of engineers is more than 0, installation is required. The installation will be automatically added upon adding an engineer.

1type GeneratorSet {
2    relation engineers : engineer[0..99];
3relation installation : install[0..5];
4   require(engineers[engineer] > 0, installation[install], "Installation is required if engineers are present");
5}
6type engineer{}
7type install{}