instances

The instances keyword declares class instances.

Purpose

This keyword is used in a ruleset declaration to declare class instances.

Context

At the top level of rulesets

Syntax

ruleset rulesetName
{
   instances (className) = value|{value1,...,valuen}; 
};

Description

Use the instances keyword to declare on which instances of a specified class the rule engine works, instead of looking for objects of this class in the working memory.

There are two ways to define class instances:

  • Give a value whose type implements the java.util.Collection package. This collection contains the objects of the specified class on which the rule engine works.

  • Explicitly specify the instances used by the engine. Values are given to compute these instances. The value type is derived from the specified class.