Show TOC

Procedure documentationCreating and Editing Compound Expressions Locate this document in the navigation structure

 

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 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.

End of the note.

Procedure

Locate the ruleset (Where is my ruleset?) and double-click the ruleset node.

Adding a Compound Expression in a Definition
  • 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>

Adding a Compound Expression in a Decision Table
  1. In the Outline view , double-click the decision table node.

  2. In the Decision Table Editor, under the action header, select a cell and press F2.

  3. In the menu that appears choose <Add a new expression>.

Adding a Compound Expression in an If-Then Rule
  1. In the Outline view , double-click the rule node.

  2. In the Rule Editor, under the If section, choose the Add icon.

  3. In the default condition that appears, chooseOperation.isSuccessful() and in the drop down menu that appears choose a definition or an alias.

  4. Choose the alias or definition and in the drop down menu choose <Add a new expression>.

    Note 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.

    End of the note.
  5. 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.

Modifying Dynamic and Static Values in Compound Expressions
  1. 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).

  2. Press Alt+ Enter to set the value.

  3. To enter a static value, enter a value in the inline text box.

Modifying Mathematical Operators

Select the operator and press the desired operator in the keyboard.

Adding Brackets in Compound Expressions

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.

    Deleting an Expression

    Place the cursor before the value in the expression and choose Delete.