Create a Rule in a Rule Set
Once you've opened the rule set for the component you want to configure, you can start adding rules to the display logic. You'll see that the display logic will already have a default rule, and you'll add your rules above it. The order in which they appear in the display logic tree is important because at runtime the rules are evaluated from top to bottom. The first rule where all the conditions are met is the one that's used, and the associated layout is applied to the component. No other rules are tested. Keep this in mind as you’re working on the display logic rules.
To configure rules in the display logic:
Create a Rule Based on User and Device
When you're creating rules, you build conditions using the dropdown lists to select an Attribute, Operator and Value. In addition to fields retrieved from the Oracle Cloud Application, the Attributes dropdown list includes some built-in variables storing details about the current user and the device they're using. You can use them, for example, to create a condition that is true only when authenticated users are viewing the page on a tablet-sized screen or larger:
You can select built-in variables that are determined by your extension's context (for example, user.email
). Two kinds of built-in extension context ($context
) variables are available:
-
user
variables are determined by the current user. For example, theuser.isAuthenticated
variable's value is True if the current user is an authenticated user. -
responsive
variables are determined by the screen size of the device your application is currently displayed on. For example, theresponsive.mdUp
variable's value is True if the current user is using a device where the screen width is 768 pixels or more, such as a tablet.
If you click you can open an editor to see and edit the expression for the rule:
$user.isAuthenticated === true && $responsive.mdUp === true ? 'managerLayout_small' : null
Note:
Depending on your Oracle Cloud Application, when using $context.user.roles
in a condition or display properties, the list of values might contain the app's pre-defined roles (for example, $context.user.roles.manager
). If the attributes list displays roles as a property, in your rule you would specify the value as true
or false
. If the roles are not listed, then type in the role name manually.