Newer Version Available

This content describes an older version of this product. View Latest

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.

When you assign a require rule to a virtual bundle (a bundle related to the sales transaction, where the parent product has no associated price), set one Product Selling Model Option on the required product to Default. For more information on Product Selling Model Options, see Manage Product Selling Model in Revenue Cloud.

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{}