Setting rule engine configuration properties

To optimize rule execution, you can create a custom configuration resource file to set rule engine configuration properties. You pass the path to this file in the rule project properties.

About this task

You manage engine configuration through the API class IlrResources. An instance of this class contains the configuration properties and their associated values.

When an IlrReflect object is created, it points to a resource bundle. This resource bundle, which is an instance of IlrResources, contains a number of configuration properties. The IlrReflect class is a subclass of IlrDynamicObjectModel. When the IlrDynamicObjectModel object is an IlrReflect object, the resource bundle is used to configure the creation of rule engines.

Engine configuration files must be loaded before the IlrReflect object is used to create the rule engines. Use the methods defined in IlrResources to load the files as shown below.

When an IlrReflect object is created to create the rule engine, it creates a new IlrResources object. You can set an alternative class loader on the IlrResources object to find your custom configuration resource file. To get and set the configuration resource file, use the following methods:

class IlrDynamicObjectModel
{
  IlrResources getResources() {...};
  void setResources(IlrResources res) {...};
};

Procedure

To set up a configuration resource file:

  1. Create a file named engine.conf that contains the configuration resource settings.
  2. Pass the path of the engine configuration file to the ruleset properties of the rule project.
    1. Right-click your rule project.
    2. Select Properties.
    3. In the Properties window, click Ruleset properties.
    4. In the Ruleset Properties page, use the Engine configuration file field and buttons to select your custom configuration file.
    5. Click OK.