You can add simple and compound expressions:
In definitions
In the conditions and assign action type in an If-Then Rule
As actions values in a decision table
Note
Expressions can be simple or compound.
Simple expressions are static or literal values which you can directly enter from the keyboard.
Dynamic values are available in a drop down menu.
A compound expression is usually in the format :E1 mathematical operator E2 where E1 and E2 can be simple or compound expressions. The common mathematical operators are : +, -, *, /
You can add a compound expression only if the return type is a primitive java type like int, float, double, byte, long, and short.
Compound expressions cannot be created if the return type is char and string.
Only one level of nesting is possible when you create compound expressions. If an expression [E1] has an argument [A1] and this argument has two expressions [E2 and E3], then neither E2 nor E3 cancontain further arguments.
Locate the ruleset (Where is my ruleset?) and double-click the ruleset node.
In the Outline view, double-click the Definitions node.
In the Definitions Editor, under the Fixed Definitions or Variable Definitions section, choose the RHS value and in the drop down menu choose <Add a new expression>
In the Outline view , double-click the decision table node.
In the Decision Table Editor, under the action header, select a cell and press F2.
In the menu that appears choose <Add a new expression>.
In the Outline view , double-click the rule node.
In the Rule Editor, under the If section, choose the Add icon.
In the default condition that appears, chooseOperation.isSuccessful() and in the drop down menu that appears choose a definition or an alias.
Choose the alias or definition and in the drop down menu choose <Add a new expression>.
Note
In the default condition Operation.isSuccessful() Equals true , if the LHS value is not set, the <Add a new expression option does not show up in the drop down menu.
In the Rule Editor, under the Then section, click the RHS value in the Assign action type syntax and choose <Add a new expression> in the drop down menu.
After you add a compound expression, click each of the values in the expression and in the drop down menu choose a dynamic value (Definitions or aliases).
Press Alt+ Enter to set the value.
To enter a static value, enter a value in the inline text box.
Select the operator and press the desired operator in the keyboard.
After you add a compound expression, click values in the compound expression where you want to add brackets. There are options such as <Add open bracket> and <Add close bracket> in the drop down menu.
Place the cursor before the value in the expression and choose Delete.