Vocabulary elements
Whether a vocabulary element is a business term, a phrase, or a constant depends on the nature of its corresponding business element.
Business term
A business term is a key concept handled in business rules. It is the verbalization of a class or nested class in the BOM.
For example, customer is a business term.
- Vocabulary
-
# org.samples.Customer org.samples.Customer#concept.label = customer
- Rule example
-
definitions set 'standard customer' to a customer from <relation> ; set 'loyal customers' to all customers in <collection> where each customer is loyalty program member ; if there are 1000 customers
Do not use the characters “ and > in term labels. They cause
warnings and ambiguity problems when used in rules.
Expression
An expression is a phrase that associates two business elements. It can be the verbalization of:
-
A method that has a non void return type
-
The getter part of an attribute
For example, {name} of {this} is an expression phrase for the attribute
Customer.name.
- Vocabulary
-
org.samples.Customer.name#phrase.navigation = {name} of {this} - Rule example
-
if the name of customer contains "Smith"
You can also use predicate phrases in rules. A predicate phrase is a specific type of expression
that verbalizes a non void method that returns a boolean or
java.lang.Boolean. A predicate phrase has an implicit subject. For example,
{this} is loyalty program member is a predicate phrase for the attribute
Customer.loyaltyProgramMember.
- Vocabulary
-
org.samples.Customer.loyaltyProgramMember#phrase.navigation = {this} is loyalty program member - Rule example
-
if customer is loyalty program member
Action
An action phrase applies an action to an object. It can be the verbalization of:
-
A method that has a void return type
-
The setter part, the adder part, the remover part, or the clearer part of an attribute
For example, in {this}, display the message : {0} is an action phrase for the
method Session.displayMessage(String).
- Vocabulary
-
org.samples.Session.displayMessage(java.lang.String)#phrase.action = in {this}, display the message : {0} - Rule example
-
then in 'current session' , display the message : "Hello!" ;
Constant
A constant is the verbalization of the public static final attribute of a class with the same type as this class.
For example, Minivan is a constant for the public static final attribute
CarGroup.Minivan.
- Vocabulary
-
org.samples.CarGroup.Compact#instance.label = Compact org.samples.CarGroup.Minivan#instance.label = Minivan
- Rule example
-
if 'my car group' is one of { Compact , Minivan }