Set Conditions for an Extension Rule
You determine when a rule is applied by defining a condition. For example, you might create a rule that is applied only when the user is in the Canada and has the Manager role.
There are two ways to define the rule's conditions. The first way is to use the basic condition builder to create conditions by selecting criteria and values. This way should be enough to define most conditions. However, if you need to create more complex conditions, and you are comfortable working with expressions, you can click Use Advanced Expression to open the visual expression editor. For more about using the expression editor, see Build Advanced Expressions.
Rules define overrides that are applied to properties only when the rule's conditions are satisfied at runtime. For conditions that use criteria in the User context, like User Authenticated ($user.isAuthenticated
) or Roles ($user.roles
), the condition is met if the logged-in user satisfies the condition.
Note:
When using $user.role in a condition, the Value drop-down lists the available Oracle Applications Cloud job and abstract roles. (The drop-down will not list any duty roles. If you want to specify a duty role, you can manually type the duty role name in the Value field.)You must be granted the ASE_REST_SERVICE_ACCESS_IDENTITY_INTEGRATION_PRIV
privilege to see the user roles in the drop-down list. Contact your instance administrator if you require this user privilege.
To create conditions for a rule:
To change the conditions for an existing rule (not a new one), click the rule under Extension Rules, then click Edit above the Conditions pane.
If you’re creating a new extension rule, the next step is to set properties for the fields in the given regions.
Create Condition Using a Field's Initial Value
When choosing a field in the condition builder, you might see fields listed under both Field Values and under Initial Field Values.
When creating a condition, you might want to use the value retrieved from the data source when the page loads—that is, the Initial Field Value. Once the page loads, the Initial Field Value doesn't change. The Field Value, on the other hand, is the value displayed or cached in a page, which may already have been modified by a rule or user. For example, say the value for the Head Count field retrieved from the data source (the Initial Field Value) is 50. There might be some rule that sets the field's value (the Field Value) to 60. The Field Value is displayed in the Head Count field in the form. The user may then change the Head Count field to 70 in the form, so the Field Value for Head Count is now 70. The Head Count Initial Field Value, however, is unaffected by changes made by rules or users, so it is still 50.
Let's look at how to add a rule so that users cannot edit the Head Count value in a form if the field's initial value is greater than 100.
- Open the page in the Designer.
- Create an extension rule to set the field's Read-Only property:
In this example, the Head Count field in the form might display a value greater than 100 and still be editable, because a rule is modifying the Head Count value. If you wish, you could create a validation rule that displays a message when the Head Count is over 100, telling the user the Head Count field value must be 100 or less. In the condition for the validation rule, make sure the rule is evaluating the Field Value (not the Initial Field Value) for the Head Count field.