Package ilog.rules.vocabulary.model.bom

Contains classes used to implement a vocabulary on top of a Business Object Model (BOM).

See: Description

Package ilog.rules.vocabulary.model.bom Description

Contains classes used to implement a vocabulary on top of a Business Object Model (BOM).

Overview

The vocabulary comprises terms and phrases attached to the elements of the Business Object Model (BOM).

A vocabulary is composed of a:

  • business term - the verbalization of a class or nested class in the BOM. For example, customer is a business term.
  • navigation phrase - a phrase that associates two business elements. For example, {last name} of {this} is a navigation phrase for the attribute Customer.lastName.
  • action phrase - applies an action to an object. For example, in {this}, display the message {0} is an action phrase for the method Session.displayMessage(String).
  • constant - the verbalization of the public static final attribute of a class with same type as this class. For example, Minivan is a constant for the public static final attribute CarGroup.Minivan.

Whether a vocabulary element is a business term, a phrase, or a constant depends on the nature of its corresponding business element.

A BOM Vocabulary is a vocabulary which is tightly tied to an IlrObjectModel, in which concepts represent classes, and fact types are mapped on members.

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);
Since:
JRules 6.0
Rule Designer API

© Copyright IBM Corp. 1987, 2017