The Rule Builder allows you to specify a set of functions whose code is evaluated when the rule engine is created.
Functions can be:
-
Called in rule actions.
- The function keyword is used to declare a function in a rule file before a rule declaration. A function can be called in the action part of a rule and you can add as many functions to the rule file as you like. This enables you to write IRL code within functions, mapped to the IRL function keyword.
-
Used to set up the working memory when testing ruleset execution in the Rule Builder.
- You can set up the working memory using the function
ilrmain
, which has the following signature: function Object ilrmain(Object ?any)
- This function serves as a principle function, used to start the application. The rule engine automatically recognizes this function as the initialization if it exists in the project, and executes it first. You can make an explicit call to this function programmatically, otherwise the rule engine automatically calls it when you execute a ruleset. In the case where there is no function
ilrmain
, the rule engine calls the method execute
. - You can only add functions to a top-level package.
For more information about the function keyword, see the ILOG Rule Language Reference Manual.
See Also
Adding Functions to a Top-Level Package | Adding Test Objects to Working Memory
|