Set Conditions for a 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 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 the Roles criterion ($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.)
To create a condition for a rule:
To change the conditions for an existing rule (not a new one), click the rule in the list, then click Edit above the Conditions pane.
If you’re creating a new rule, the next step is to set properties for the fields.
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.
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.
Build Advanced Expressions
When creating conditions for business rules, you may find your conditions are more complex than you can achieve using the basic condition builder. If this occurs, you can build your own custom expressions to suit your needs.
Note:
If you use advanced expressions in the condition builder, you will no longer be able to use the basic condition builder. If you have already defined some conditions in the basic condition builder, they will be displayed as actions in the Advanced Expression editor.To create an advanced expression:
When you look at your rule, the condition looks like this if it's created using the expression editor:
















