What Are Business Rules?

Business rules allow you to override the appearance and behavior of fields or regions on a page, provided that the specified conditions in a rule are met at runtime. In this context, a region is simply a dynamic form.

Note:

If you're looking for information on business rules as they pertain to business objects, see Create Rules for Business Objects.

In Visual Builder Studio (VB Studio), all the elements that control how dynamic tables and forms are rendered on a page are configured in a Layout. Some Layouts are governed by rule sets (note the Rule Sets editor tab at the far left) which influence the appearance or behavior of dynamic tables or forms through the use of display logic. Within the rule set, each rule optionally defines a condition (such as, "Is the current user a manager?"), plus a layout to apply to the page when that condition is true. A layout might hide a field in a dynamic form, show a field, or otherwise impact the page's appearance or behavior.

Description of metadataruleset.png follows
Description of the illustration metadataruleset.png

For certain Oracle Cloud Applications, however, Oracle chooses to employ Layouts defined by business rules, instead of rule sets. Conceptually similar to rule sets, business rules can handle simple and complex display needs that might otherwise require tens, if not hundreds, of individual layouts if the rule set approach was used instead.

For example, suppose you had a data object called Person that was used in two dynamic forms. Each of these correspond to a different rule set on the Rule Sets tab. Now suppose you want to hide the Organization Name field when the user is a manager, as only HR specialists should see this data. With rule sets, you'd have to add a new rule to each layout with the condition "if user=manager", plus a new layout that hides the Organization Name field when the condition is true. With business rules, on the other hand, you can create a single rule that defines the condition, then overrides the setting for the Hidden property to ensure that Organization Name is hidden when the user is a manager. With this one action, the Organization Name field will be hidden for every region that includes that field.

In other words, business rules let you define a rule at the object level. Let's look at a page with two dynamic forms (Detailed department and NewForm). These are listed in the Regions and Fields section in the image below. Both components use fields from the same data object, and you can quickly see every field used in each component. For example, the Detailed department region consolidates all the fields that are displayed in the form, regardless of the layouts defined in the form. The same applies to the NewForm region. When you set a property in a business rule you are setting it at the object level, so it can be applied to every occurrence of that field, in each component using that data object.

Description of metadata-pill.png follows
Description of the illustration metadata-pill.png

There are two types of rules: extension rules, which are created by you, the extension developer; and built-in rules, which are created by Oracle as part of your extension dependencies. In this example, the Default rule is a built-in rule defined in an extension dependency.

The name of the dependency where the Default rule is defined is jmfactory Extension. The name of the dependency is visible to the right of the rule name when the Default rule is selected in the list of rules.