By Gustavo Mendoza Gamez
Boolean attributes often appear in business object models. They represent flags or indicators that business users check (conditions) or set (actions) in business rules. The default handling of Boolean attributes can result in clumsy phrasing of business rules. Using extenders, however, you can change how these attributes appear in rules, making life very much easier for business users.
For example, an airline customer might have the Boolean attribute isLoyaltyMember that is set to true when the customer is a member of the airline’s loyalty program. With the default handling for Boolean attributes, a business rule author might see the following in their business rules:

Or for negating the condition:

And the following for changing the value of the attribute:

Or for setting the attribute to false:

The default handling can be a bit confusing for some business users; when they read them, the business rules don’t quite flow naturally.
To make it easier to read (and write) business rules with Boolean attributes, you can extend the attribute’s class (customer in our example) and add get and set methods for the attributes, to which you then give more natural-sounding verbalizations. The following procedure shows how you could do this for the loyalty program example:
1. Remove the default verbalization for the isLoyaltyCustomer attribute. In the BOM editor for the attribute isLoyaltyCustomer select Remove the verbalization

2. Add an extender class to define all methods associated with the Customer. The name can be defined as  CustomerExtender.java with the following methods:


3. Verbalize the new methods:




This will result in the following phrases available in the rules:

Or for negating the condition:

And the following for changing the value of the attribute:

Or for setting the attribute to false:

As a result, the language in the rules will flow better and will be easier to understand, reducing the learning curve for the business users when it comes to authoring rules.

Join The Discussion

Your email address will not be published. Required fields are marked *