Rule Builder > Ruleset Parameters > Working With Ruleset Parameters > Modifying Ruleset Parameters

Ruleset parameters can be modified in several ways:

Context Dependency

Ruleset parameters can be considered as being "context dependent". This means that when the IlrContext.updateContext() method is called, all rule conditions in which ruleset parameters appear are reevaluated. However, this does not mean that every time a ruleset variable is modified, you must call IlrContext.updateContext(). This call is needed only if a reevaluation of the rule conditions in which the parameter is referenced is required.

If you write BAL rules, the IlrContext.updateContext() statement is automatically added to the rule during IRL code generation, but if you write IRL or TRL rules, refer to the Java API Reference Manual for details of how to use the IlrContext.updateContext() statement.

Functions

You can insert ruleset parameters in the rule engine working memory using the functions feature. You must first create a FunctionSet in the Rule Builder under a top-level package and then write the code using the Functions Editor.

For example, assuming that a ruleset parameter param has been created in the Rule Builder, you could write:

function void ilrmain (Object o)
{
insert(param);
execute();
}

Virtual BOM Methods

You can create a virtual method in the BOM, whose translation sets the parameter(s). For example, if you have a parameter named Parameter, you can create two BOM methods:

You can then use these methods anywhere, including in decision tables and decision trees, to set or get values of a parameter.

See Also

Virtual BOM Classes | Setting Ruleset Parameter Values | Adding Functions to a Top-Level Package | Adding Ruleset Parameters to a Top-Level Package


Customer Support | Copyright © 1987-2004 ILOG S.A. All rights reserved. Legal terms. PREVIOUS   NEXT