How to Use Advanced Mode Action Forms
This section explains how to use Advanced Mode Action forms.
When you create a rule with Advanced Mode, Rules Designer presents a list with the available actions shown in Advanced Mode Action Options in Rule Designer. For each form shown in Advanced Mode Action Options, the options that Rules Designer presents are context sensitive. Thus, the lists and the number of items you see when you work with the action types are context sensitive, depending on which action you add and the choices you make while you enter the action.
To use advanced mode action forms:
Advanced Mode Action Options in Rule Designer
Table 1-18 Advanced Mode Action Options
Action Form | Description |
---|---|
|
Assert a fact |
|
Asserts a tree of facts given the root. |
|
Assert a new fact. |
|
Assign a value to a variable. |
|
Assign a value to a new variable. |
|
Perform expression. |
|
Call a function. |
|
Oracle RL, like Java, has a for loop. A for loop includes a type with a variable and a collection. The type and variable defines the loop variable that holds the collection value used within the loop. Collection is an expression that evaluates to a collection of the correct type for the loop variable. You can use a for loop to iterate through any collection. A return, throw, or halt may exit the action block. |
|
Using the if else action, if the test is true, execute the first action block, and if the test is false, execute the optional else part, which may be another if action or an action block. Oracle RL, unlike Java, requires action blocks and does not allow a single semicolon terminated action. |
|
Modify a data value associated with a matched fact. |
|
Retract a fact. |
|
The return action returns from the action block of a function or a rule. A return action in a rule pops the ruleset stack, so that execution continues with the activations on the agenda that are from the ruleset that is currently at the top of the ruleset stack. |
|
Use an Oracle RL expression that you supply. |
|
As in Java, the synchronized action is useful for synchronizing the actions of multiple threads. The synchronized action block lets you acquire the specified object's lock, then execute the action-block, then release the lock. |
|
Throw an exception, which must be a Java object that implements java.lang.Throwable. A thrown exception may be caught by a catch in a try action block. |
|
The try, catch, and finally in Oracle RL is like Java both in syntax and in semantics. There must be at least one catch or finally clause. |
|
While the test is true, execute the action block. A return, throw, or halt may exit the action block. |