Reverse-engineering a Model Creating and Reverse-Engineering a Model

5-6 Oracle Fusion Middleware Developers Guide for Oracle Data Integrator

5. Select Save from the File main menu.

The datastore is created. If this is a File datastore, refer to the Reverse-Engineering File Datastores section for creating columns for this datastore. It is also possible to manually edit columns for all datastores. See Adding and Deleting Datastore Columns for more information.

5.3.2 Reverse-Engineering File Datastores

Oracle Data Integrator provides specific methods for reverse-engineering flat files. The methods for reversing flat files are described below.

5.3.2.1 Reverse-Engineering Fixed Files

Fixed files can be reversed engineered using a wizard into which the boundaries of the fixed columns and their parameters can be defined.

1. Go to the Columns tab the file datastore that has a fixed format.

2. Click the Reverse button. A window opens displaying the first records of your file.

3. Click on the ruler above the file contents to create markers delimiting the columns. Right-click in the ruler to delete a marker. 4. Columns are created with pre-generated names C1, C2, and so on. You can edit the column name by clicking in the column header line below the ruler. 5. In the properties panel on the right, you can edit the parameters of the selected column.

6. You must set at least the Column Name, Datatype and Length for each column.

Note that column names of File datastores cannot contain spaces.

7. Click OK when the columns definition is complete to close the wizard.

8. Select Save from the File main menu.

5.3.2.2 Reverse-Engineering Delimited Files

Delimited files can be reversed engineered using a a built-in JDBC which analyzes the file to detect the columns and reads the column names from the file header.

1. Go to the Columns tab the file datastore that has a delimited format.

2. Click the Reverse button.

3. Oracle Data Integrator creates the list of columns according to your file content. The column type and length are set to default values. Column names are pre-generated names C1, C2, and so on or names taken from the first Header line declared for this file.

4. Review and if needed modify the Column Name, Datatype and Length for each

column. Note that column names of File datastores cannot contain spaces.

5. Select Save from the File main menu.

5.3.2.3 Reverse-Engineering COBOL Files

Fixed COBOL files structures are frequently described in Copybook files. Oracle Data Integrator can reverse-engineer the Copybook file structure into a datastore structure.

1. Go to the Columns tab the file datastore that has a delimited format.

2. Click the Reverse COBOL Copybook button.

Creating and Reverse-Engineering a Model 5-7 3. Fill in the following fields: ■ File : Location of the Copybook file. ■ Character Set : Copybook file character set. ■ Description format EBCDIC or ASCII: Copybook file format ■ Data format EBCDIC or ASCII: Data file format.

4. Click OK. The columns described in the Copybook are reverse-engineered and

appear in the column list.

5. Select Save from the File main menu.

5.3.3 Adding and Deleting Datastore Columns

To add columns to a datastore:

1. In the Columns tab of the datastore, click Add Column in the toolbar menu.

2. An empty line appears. Fill in the information about the new column. You should at least fill in the Name, Datatype and Length fields. 3. Repeat steps 1 and 2 for each column you want to add to the datastore.

4. Select Save from the File main menu.

To delete columns from a datastore:

1. In the Columns tab of the datastore, select the column to delete.

2. Click the Delete Column button. The column disappears from the list.

5.3.4 Adding and Deleting Constraints and Filters

Oracle Data Integrator manages constraints on data model including Keys, References, Conditions and Mandatory Columns. It includes a data integrity framework for ensuring the quality of a data model based on these constraints. Filters are not constraints but are defined similarly to Conditions. A Filter is not used to enforce a data quality rule on a datastore, but is used to automatically filter this datastore when using it as a source.

5.3.4.1 Keys

To create a key for a datastore:

1. In the Designer Navigator, expand in the Model tree the model and then the

datastore into which you want to add the key.

2. Select the Constraints node, right-click and select New Key.

3. Enter the Name for the constraint, and then select the Key or Index Type. Primary

Keys and Alternate Keys can be checked and can act as an update key in an interface. Non-Unique Index are used mainly for performance reasons.

4. In the Columns tab, select the list of columns that belong to this key.

5. In the Control tab, select whether this constraint should be checked by default in a

Static or Flow check.

6. By clicking the Check button, you can retrieve the number of records that do not

respect this constraint.

7. Select Save from the File main menu.

5-8 Oracle Fusion Middleware Developers Guide for Oracle Data Integrator

5.3.4.2 References

To create a reference between two datastores:

1. In the Designer Navigator, expand in the Model tree the model and then one of

the datastores into which you want to add the reference.

2. Select the Constraints node, right-click and select New Reference.

3. Enter the Name for the constraint, and then select the Type for the reference. In a

User Reference the two datastores are linked based on column equality. In a Complex User Reference any expression can be used to link the two datastores. A Database Reference is a reference based on column equality that has been reverse-engineered from a database engine.

4. If you want to reference a datastore that exists in a model, select the Model and

the Table that you want to link to the current datastore. 5. If you want to link a table that does not exist in a model, leave the Model and Table fields undefined, and set the Catalog, Schema and Table names to identify your datastore.

6. If you are defining a User or Database reference, in the Columns tab, define the

matching columns from the two linked datastores.

7. If you are defining a Complex User reference, enter in the Expression tab the

expression that relates columns from the two linked datastores.

8. In the Control tab, select whether this constraint should be checked by default in a

Static or Flow check.

9. By clicking the Check button, you can retrieve the number of records that respect

or do not respect this constraint.

10. Select Save from the File main menu.

5.3.4.3 Conditions

To create a condition for a datastore:

1. In the Designer Navigator, expand in the Model tree the model and then one of

the datastores into which you want to add the condition.

2. Select the Constraints node, right-click and select New Condition.

3. Enter the Name for the constraint, and then select the Type for the condition. An

Oracle Data Integrator Condition is a condition that exists only in the model and does not exist in the database. A Database Condition is a condition that is defined in the database and has been reverse-engineered.

4. In the Where field enter the expression that implements the condition. This

expression is a SQL WHERE expression that valid records should respect.

5. Type in the Message field the error message for this constraint.

6. In the Control tab, select whether this constraint should be checked by default in a

Static or Flow check.

7. By clicking the Check button, you can retrieve the number of records that do not

respect this constraint.

8. Select Save from the File main menu.

5.3.4.4 Mandatory Columns

To define mandatory columns for a datastore: