the name of this rule

This construct returns the name of the currently executed rule in the then part of a business rule.

Purpose

You use this construct to provide an audit trail, for example, by logging a message that quotes the name of the rule whenever it is executed.

Syntax

the name of this rule

Description

This construct displays the name of the current rule as a string. It can be useful as a means of providing an audit trail. Each time a rule is executed, you can log a message that this rule was executed.

The variable is of type String and contains the name of this rule. It is only available in the action part of the rule.

Example

The following action would return the name of the executed rule, Retired_Customer_Policy for example.

if 
    the age of the customer is greater than 65 
then 
    print the message "A 5% discount has been applied to policy: " + the name 
of this rule;