Package ilog.rules.vocabulary.model

Contains classes and interfaces related to the set of terms and phrases attached to the elements of the Business Object Model (BOM) of a rule project.

See: Description

Package ilog.rules.vocabulary.model Description

Contains classes and interfaces related to the set of terms and phrases attached to the elements of the Business Object Model (BOM) of a rule project.

Overview

When a user creates a BOM entry using Rule Studio, the default setting is to verbalize the elements imported from the Execution Object Model (EOM) to create a vocabulary. A vocabulary is composed of the set of business terms, phrases, and constants used to verbalize an EOM. In the API, the vocabulary for a project is stored in an IlrVocabulary instance. This object contains all the terms, phrases and constance that make up the vocabulary. Concepts are retrieved by calling IlrVocabulary.getConcepts(). Phrases inside a vocabulary are stored in IlrSentence instances which are themselves stored inside IlrFactType objects .

Vocabuary structure

Whether a vocabulary element is a business term, a phrase, or a constant depends on the nature of its corresponding business element. The following table shows the series of concepts, phrases and constants that makes up a vocabulary.

Name
Description
Example
Class
Business Term
A Business Term is the label of a vocabulary concept. This label is the natural language (and local dependant) word designating a concept. That is, it is the verbalization of a class or nested class in the Business Object Model.
customer
IlrConcept
Navigation Phrase
A navigation phrase is a phrase that associates two business elements. It can be the verbalization of either:
  • A method that has a nonvoid return type
  • The getter part of an attribute
{last name} of {this} IlrSentence
type: IlrSentenceCategory
Predicate Phrase
A predicate phrase is a specific type of navigation phrase that verbalizes a nonvoid method that returns a boolean or java.lang.Boolean. A predicate phrase has an implicit subject.
{this} is loyalty program member IlrSentence
type: IlrSentenceCategory.PREDICATE
Action Phrase
An action phrase applies an action to an object.  It can be the verbalization of either:
  • A method that has a void return type.
  • The setter part of an attribute.
in {this}, display the message {0}
IlrSentence
type: IlrSentenceCategory.ACTION
Constant
A constant is the verbalization of the public static final attribute of a class with same type as this class.
Minivan is a constant for the public static final attribute CarGroup.Minivan
IlrConceptInstance

Note: Only business rule artifacts use the vocabulary, technical rule artifacts do not.

Code example

The following code example shows how to use a IlrBOMVocabularyFactory instance class to create a vocabulary from a BOM.

  Locale vocabularyLocale = new Locale("en", "US");
  IlrVocabularyGeneratorConfiguration config = new 
           IlrVocabularyGeneratorConfiguration(IlrVerbalizationGenerator.BUSINESS);
  config.useLegacyAlternates(false);
  // Generate minimal vocabulary, only classes and members used by space coverage
  config.setModelFilter(new IlrGapReportModelFilter(report));
  
  IlrVocabulary boot = IlrBOMVocabularyHelper.getBootVocabulary(vocabularyLocale);
  IlrBOMVocabulary vocTmp = IlrBOMVocabularyHelper.loadBOMVocabulary(vocabularyLocale, "alltypes", this.getClass().getClassLoader(), "UTF-8");
  IlrBOMVocabulary voc = IlrBOMVocabularyFactory.createBOMVocabularySet(
                        vocabularyLocale,
            new IlrBOMVocabulary[] {
              (IlrBOMVocabulary) boot,
              (IlrBOMVocabulary) vocTmp
            },
            false);


  // Return the verbalization provider
  Map rulesetParametersEnglishVerbalization = new HashMap();
  rulesetParametersEnglishVerbalization.put("loan", "the loan");
  rulesetParametersEnglishVerbalization.put("borrower", "the borrower");
  return new IlrDefaultRulesetVerbalizationProvider(voc, rulesetParametersEnglishVerbalization);
One of the most common uses of this API is to create a custom verbalizer. For more information, see
ilog.rules.vocabulary.verbalization packages.

@since JRules 6.0

Rule Designer API

© Copyright IBM Corp. 1987, 2017