Defining ruleset variables

A ruleset variable defines a value of a specified type and verbalization. You can use ruleset variables in all the business rules you add to a rule project, and as input and output parameters in decision operations.

About this task

To define a ruleset variable, you first need to create a variable set in which to group your ruleset variables. You then define one or more variables in the variable set. Ruleset variables are variables that you can use in all the business rules of the ruleset. You can also use ruleset variables to pass data between tasks in a ruleflow. Ruleset variables are accessible from business rules only if you verbalize them.

Procedure

  1. In your Rules or BOM project, click the create an artifact button and select New variable set.
  2. Enter a name for the variable set and click Create.
  3. In the variable set editor, click Add variable to add a variable to this variable set.
  4. Enter a name and a verbalization, and select a type for the variable.

    Name: the name of the variable must be a valid Java™ identifier. A Java identifier can contain uppercase, lowercase, and modifier Unicode letters, Unicode digits, currency symbols, and the ASCII underscore (_). The first character of the name must be a letter, a currency symbol, or an underscore.

    Type: the type must be one of the available types in the drop-down menu, or a technical Java type.

    Verbalization: specifying a verbalization is optional, but it is necessary to make the variable visible from business rules.

  5. Click Save.

Results

The ruleset variable is now defined and you can start using it in business rules or as input and output parameter in decision operations.