Rule Builder > Business Object Models > Working With the BOM Explorer > Adding Elements to a BOM

You can create seven types of element in the BOM Explorer:

Packages

Packages are a way of grouping classes and uniquely referring to them using Java-like fully qualified names.

To create a new root package in the BOM Explorer:

  1. Right-click the BOM and then click Add Package on the shortcut menu.
  2. Type in a name for the package and press Enter or click away from the field to register it.

To create a new subpackage in the BOM Explorer:

  1. Right-click the top-level package and then click Add Package on the shortcut menu.
  2. Type in a name for the subpackage and press Enter or click away from the field to register it.

Classes

Classes may be virtual or directly imported from the XOM. These classes can also be inner (sub)classes.

To create a new class at the root of the BOM:

  1. Right-click the BOM and the click Add Class on the shortcut menu.
  2. Type in a name for the class and press Enter or click away from the field to register it.

To create a new class in a package:

  1. Right-click a package and then click Add Class on the shortcut menu.
  2. Type in a name for the class and press Enter or click away from the field to register it.

To create a subclass:

  1. Right-click a class and then click Add Class on the shortcut menu.
  2. Type in a name for the subclass and press Enter or click away from the field to register it.
    Note
    A BOM class created using the Add Class menu entry does not extend the <java.lang.Object>. To extend it, use the BOM Graphical Editor and create a generalization link between the <java.lang.Object> and the new class. Creating a generalization link enables you to include <java.lang.Object> methods in the BAL, for example:
    • boolean is(Object)
    • boolean isNot(Object)

    <java.lang.Object> methods can be used to do object comparisons.

BOM classes and BOM class members have properties, displayed in the Property Sheet, that can influence their behavior. For more information see BOM Class Properties and BOM Class Member Properties.

Methods

To create a new method in the BOM Explorer:

  1. Right-click a class and then click Add Method on the shortcut menu.
  2. Type in a name for the method and press Enter or click away from the field to register it.

Arguments

To create a new argument in the BOM Explorer:

  1. Right-click a method and then click Add Argument on the shortcut menu.
  2. Type in a name for the argument and press Enter or click away from the field to register it.

Attributes

The return type of attributes can be primitive types and classes that belong to the java.lang and java.util packages.

To create a new attribute in the BOM Explorer:

  1. Right-click a class and then click Add Attribute on the shortcut menu.
  2. Type in a name for the attribute and press Enter or click away from the field to register it.

References

References are attributes with a nonprimitive or "common" return type. Common classes are the classes that belong to the java.lang and java.util packages.

To create a new reference in the BOM Explorer:

  1. Right-click a class and then click Add Reference on the shortcut menu.
  2. Type in a name for the reference and press Enter or click away from the field to register it.

Enumerated Domains

You can display a menu with the names of various items using enumerated domains. An enumerated domain allows you to group together a set of identifiers that represent different values. A BOM class can have an associated enumerated domain so that when an instance of this class is queried, BAL will display a menu with the names of the various items.

The enumerated domain of a class can be defined in the Rule Builder using the BOM Explorer. The properties of the enumerated domain and domain items can be edited in the Property Sheet in the usual way.

To add an enumerated domain to a class in the BOM Explorer:

  1. Right-click a class and then click Add Enumerated Domain on the shortcut menu.
  2. Type in a name for the domain and press Enter or click away from the field to register it.

To add domain items to the domain:

  1. Right-click the domain and then click Add Domain Item on the shortcut menu.
  2. Type in a name for the domain item and press Enter or click away from the field to register it.

For more information on how to set up enumerated domains and use them in BAL rules, refer to the Business Action Language User's Manual.

See Also

Using the BOM Date and Time Classes | Virtual BOM Classes | Creating Links | Setting the supertypes Property


Customer Support | Copyright © 1987-2004 ILOG S.A. All rights reserved. Legal terms. PREVIOUS   NEXT