Rule Builder > Managing Decision Tables > Exporting and Importing Decision Tables > Importing |
Importing |
PREVIOUS NEXT |
You can import data from an external data source to a decision table using the following formats and facilities:
Importing CSV data to a prestructured decision table follows a predefined protocol. The CSV data is mapped according to the number of columns and subcolumns of the decision table. The hierarchical structure of the table is formed according to empty or twin values.
Here is a example of importing data using the CSV protocol. The CSV file contains the following data, and the predefined structure of the decision table is shown in Figure 12.74 with the data imported.
18, Silver, 10, 20, 1 |
There are two empty values in the first column of the CSV file, so the value 18 will get three partition items as children, as you can see in the resulting decision table. The Revenues column requires two parameters, so two columns from the CSV file are mapped to this column.
In the previous example, only data were imported. An extended protocol allows you to change the default predicates for numeric and date values.
=
, <
, <=
, >
, >=
, !=
Here is an example of the extended protocol, with the result of the import shown in Figure 12.75.
<=18, Silver, 10, 20, 1 |
Note |
In the CSV data, if, instead of empty values under the 18, 18 was duplicated, the result of the import would be the same. |
The interface ilog.rules.dt.model.provider.IlrDTDataProvider
provides a way to populate a decision table model from your data. For this purpose, the structure of the decision table must be defined with the Rule Builder. Then you must implement this interface on the data.
An IlrDTDataProvider
is hierarchically structured. As in the CSV import protocol, this hierarchical structure defines how partition items are created and organized. For easy implementation of IlrDTDataProvider
, you can derive IlrDTAbstractDataProviderTableModel
which is an abstract class to map the decision table model to a classic table model.
Using the example in The CSV Protocol, when the import process requests the data from the interface, the definition of the Revenues column requires two parameters to be grouped to define the min
and max
values.
See the Java API Reference Manual for further details on IlrDTDataProvider
.
Decision Table / Tree Predicates | Decision Table / Tree Supported Data Types | The CSV Protocol
Customer Support | Copyright © 1987-2004 ILOG S.A. All rights reserved. Legal terms. | PREVIOUS NEXT |