Business rule translation intermediate form

An important part of the translation framework is the intermediate form, which the code generator uses to represent the final structure of the IRL code.

Deprecated feature:

Deprecation icon Support for custom business rule languages is deprecated in V8.8.1. This feature will be removed in a future release of the product. See Deprecated features for migration details.

The intermediate form is an important part of the translation framework because it is the base for code generation. The code generator uses it to represent the final structure of the IRL code.

The root class of the intermediate form is IlrRuleStatement, which represents the rule that will be generated. An IlrRuleStatement has headers, conditions, actions and else-actions, and a unique evaluate statement. Each of these statements has a reference to the abstract syntax tree node that generated them, as well as additional properties, specific to each type of statement.

Header statements

Header statements (IlrHeaderStatement) represent headers of the output IRL rule. Currently, only the IRL use clause is supported. IlrHeaderStatement has one mandatory value field, which contains the IRL expression of the header statement.

Condition statements

Conditions statements (IlrConditionStatement) represent condition statements of the output IRL rule. Bindings and evaluate statements are represented by subclasses of IlrConditionStatement (respectively IlrBindingStatement and IlrEvaluateStatement).

Evaluate statement

The evaluate statement (IlrEvaluateStatement) represents the last evaluate statement containing all the conditions of the business rule.

Action statements

Action statements (IlrActionStatement) represent IRL statements of the action part (or else-action part).

Actions are divided into two groups:

  • Simple actions (IlrSimpleActionStatement), which are one-line actions such as method calls and update actions

  • Block actions (IlrBlockActionStatement), which represent actions such as for each loops that group other actions (including other block actions).

Both IlrSimpleActionStatement and IlrBlockActionStatement have a kind property that identifies the kind of action or block action. IlrBlockActionStatement contains an ordered list of IlrActionStatement.

To define custom kinds of actions (simple or block), use the constant CUSTOM_EXTENSION. Make sure that you handle the translation of custom kinds of actions. See (deprecated) Customizing business rule translation to IRL.

Bindings

IRL bindings are represented by instances of IlrSimpleBindingStatement. Different kinds of binding are identified by the kind property. All kinds of simple bindings are defined as constants on IlrSimpleBindingStatement.

To define custom kinds of bindings, use the constant IlrSimpleBindingStatement. CUSTOM_EXTENSION. Make sure that you handle the translation of custom kinds of bindings. See (deprecated) Customizing business rule translation to IRL).

IlrSimpleBindingStatement contains several fields:

  • concept, which references the type of the binding

  • inSyntaxNode, an optional field that references the node for the in clause of the binding

  • fromSyntaxNode, an optional field that references the from clause of the binding