Reference > Rule Languages > Business Action Language > BAL Constructs > the name of this rule

Summary

Returns the name of the currently executed rule in the then part of a business rule.

Syntax

the name of this rule

Description

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

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; 

Related Concepts

Rule Actions

Related Tasks

Creating Business Rules

Related Reference

else
then
for each <object> in <list>

Related Samples and Tutorials

Tutorial: Creating Business Rules