ILOG JRules User Guide > Writing Rules > Tasks > Defining Ruleset Variables

Ruleset variables are variables that you can use in all the rule artifacts of the ruleset. To define a ruleset variable, you first need to create a variable set in which to group your ruleset variables.

To create a variable set:

  1. Select your rule project and on the File menu click New > Variable Set.
  2. The New Variable Set wizard opens.
  3. If you want to select a rule package, click Browse next to the Package field.
  4. Type the name of your variable set in the Name field.
  5. Click Finish.
  6. The new variable set appears in the Rule Explorer view and the Variable Set Editor opens.

You can now define your ruleset variables.

To define a ruleset variable:

  1. In the Variable Set Editor, click Add.
  2. A new ruleset variable appears as a line in the table.
    Ruleset Variable
  3. Specify the name, type and (optionally) the initial value of the ruleset variable.
  4. If you do not want the ruleset variable to be visible from business rule artifacts, delete the default verbalization from the Verbalization column. Otherwise, modify the verbalization.

The ruleset variable is now defined and you can start using it in rule artifacts.

To modify the verbalization of a ruleset variable:

  1. In the Variable Set editor, select the variable in the table and click Refactor.
  2. In the Refactor Variable dialog, type a new verbalization for the variable in the Variable verbalization field.
  3. If you want to see the impact of the change on the rule artifacts, click Preview.
  4. The Refactor dialog shows which artifacts (if any) need to be refactored.
  5. Click OK.
  6. The rule artifacts are refactored.

Related Concepts

Automatic Variables
Ruleset Variables
Rule Definitions

Related Tasks

Defining Ruleset Variables
Setting Up Automatic Variables
Creating Ruleset Parameters

Related Reference

Variable Set Editor

Related Samples and Tutorials

Tutorial: Creating Business Rules