Decision engine

The decision engine is designed to optimize the execution performance of your rulesets.

Deprecated feature:

Deprecation icon Intermediate code generation is deprecated as of V9.0.0.0. For more information, see Deprecated and removed features.

Before the deployment of a decision service with the XOM enabled in Decision Center, the rules are compiled by default to executable code (Java™ bytecode). For a decision service that does not have the XOM enabled, Decision Center compiles the rules to intermediate code that requires only a final translation into executable code at run time.

Tip: Rule Designer compiles the rules by default to executable code. Deselect the Optimize ruleset loading (Java bytecode generation) option on the Export a Ruleset Archive page in Rule Designer to compile the rules to intermediate code.

The following features are included with the decision engine:

  • Fastpath, sequential, and RetePlus execution modes
  • Working memory and agenda features that enable you to store and manipulate application objects
  • Agenda that lists and orders the rule instances that are eligible for execution

Workflow for running rules with the decision engine

To run rules with the decision engine, do the following steps:

  1. Create a rule project to encapsulate the business logic of your legacy applications.

    If these applications are based on COBOL, use COBOL management features in Rule Designer (see Designing a BOM for a COBOL model).

  2. Test the execution of the rules in Rule Designer, which uses the decision engine.

  3. Deploy the ruleset to the persistence layer:
  4. Call the ruleset by using API:

    In running the rules with Rule Execution Server, the API uses the decision engine.

Compilation and execution

The decision engine compiles rule artifacts into an archive that contains compiled and optimized code that becomes executable when translated to Java bytecode.

Parsing, compiling and optimizing code are demanding tasks when you load a ruleset. Consequently, the ruleset loading in the decision engine is fast because no code is parsed or interpreted at run time. All the code is already compiled (to intermediate code or Java bytecode) and fully optimized for rule execution.

The following figure shows the process of compilation and execution for the decision engine, with or without Java bytecode generation. This process goes through different stages from the initial compilation of rules until the execution of rules.

The diagram shows the decision engine with and without Java bytecode generation.
Important: Bytecode generation improves the loading time of rulesets that are built with the decision engine. In Rule Designer and Decision Center, the bytecode generation option is selected by default. However, for Decision Center, you must have enabled the XOM management to be able to activate the bytecode generation. With Rule Execution Server, there is a way to optimize the translation from intermediate code to Java bytecode. You can use the compiled archives cache to limit this bytecode generation to the first time that a decision engine ruleset is loaded. For more information, see Setting the compiled archives cache.

The following table shows features in the decision engine.

Table 1. Decision engine features
Feature Decision engine
Rule conversion The BAL rules are converted to the Advanced Rule Language (ARL). In Rule Designer, the ARL tab for BAL rules and decision tables provides a preview of the compilation of the rule.

In the BOM editor, you can work directly with ARL to define the BOM-to-XOM mapping for rule projects that are designed for decision engine.

You can use IRL in technical rules, ruleflow action tasks, and functions.

BigDecimal objects Doubles are converted to BigDecimal objects by using the following statement: scoreResponse.cpScore = new java.math.BigDecimal(Math.exp(value.doubleValue()));
Rule and ruleflow compilation The rules and ruleflow are fully compiled to intermediate code or Java bytecode before deployment.
Execution code The ruleset archive .dsar file consists of binary files that contain execution code for the rules and ruleflows.