Rule Builder > Business Object Models > Working With the BOM Property Sheet > Using the BOM Date and Time Classes

The default BOM that forms part of a new repository contains date and time classes that you can use in time expressions. These BOM classes are associated to specific value editors that simplify the entering of date related values.

Table 8.4   BOM Date and Time Classes
BOM Class 
Presented As... 
Mapped to XOM As... 
dayOfWeek  A combo box that lists the day of the week.  java.util.util.Calendar.<dayOfWeek> 
month  A combo box that lists the month of the year.  java.util.util.Calendar.<monthOfYear> 
simpleDate  A calendar that allows the user to set the date without minutes/seconds/milliseconds.  java.util.Date 
time  A textfield that accepts time with the format HH:MM.  java.util.Date 
year  A text field that accepts the year with the format YYYY.  int 

These classes are shown in Table 8.4:

An example of a default BOM showing the date and time classes is given in Figure 8.24.

images/bom_dateclasses.png

Figure 8.24    BOM Date and Time Classes

The following example shows how to use the date classes in rules. The example is based on the CreditAnalysis repository that can be found in the BRE Server Tutorial in the directory <InstallDir\tutorials\bres\task1\data

Proceed as follows:

  1. Open the CreditAnalysis repository and then the BOM Explorer.
  2. In the BOM Explorer, right-click the Borrower class and then click Add Attribute on the shortcut menu to add the date classes you want to have as attributes of this class, see Figure 8.25.

  3. images/bom_attributes.png
  4. Figure 8.25    Date Attributes
  5. In the Property Sheet, fill in the alternate field with the text you want to appear in the selection window and select the type, see Figure 8.26.

  6. images/bom_properties.png
  7. Figure 8.26    Setting the alternate and type Fields
  8. In the Project Explorer, right-click a package and then click Add BAL Rule on the shortcut menu.
  9. Now use the Rule Editor to define your rule. The date and time attributes should appear as choices in the selection window, see Figure 8.27.

  10. images/bom_datechoices.png
  11. Figure 8.27    Date Attributes in the Selection Window
  12. Add the conditions and actions that you want. An example rule is given in Figure 8.28.

  13. images/bom_balrule.png
  14. Figure 8.28    Example BAL Rule with Date and Time Conditions

For more information, see the Business Action Language User's Manual.

See Also

Adding Elements to a BOM | Adding and Editing Attributes | Working With the BOM Property Sheet


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