Integration Engine Solutions to Connect Anything to Anything

Log out?

Purpose:

To practice transforming fixed-width files using the File Spec Editor and Field Record Control conditions.



Create a Route

    1. From the eiConsole File Management screen, select the Add Route button.
    2. In the dialog that appears, enter the name Conditional Fixed-Width Files and select OK.
    3. The Route should now appear in the table on the screen. Double-click it to open it.

Document Source System

    1. Select the Source System stage in the Route Editing Grid. The configuration panel will appear at the bottom.
    2. Change the System Name to Text File
    3. Select the Choose Source Icon button, and scroll down to select one of the plain file icons

Configure the Listener

    1. Select the Listener stage in the Route Editing Grid. The configuration panel will appear at the bottom.
    2. Select Directory / File from the Listener Type selection box. Optionally, click the button to open the Module Search Dialog, which provides a faster way to find the module you’re looking for.
    3. Assign a polling directory, using the button to open the file selector. The polling directory should NOT be the directory with all the sample files, since files will be moved/deleted by the listening process.

Add Source Transformation Module

    1. Select the Source Transform stage in the Route Editing Grid. The configuration panel will appear at the bottom.
    2. Click the Add Format button. In the dialog that appears, name the Format People Conditional Fixed File Spec, and click OK. The transformation configuration panel will appear below.
    3. Select Delimited and Fixed-Width File from the Transformation Module selection box. Optionally, click the button to open the Module Search Dialog, which provides a faster way to find the module you’re looking for.
    4. In the new configuration panel that appears below, select the Edit button next to the File Spec configuration field to open the File Spec Editor.

Create a File Spec

    1. When the File Spec Editor opens, a dialog called Select for New File Type will be present. In the sole selection box, choose the last option in the list, called User-defined, and click Next.
    2. In the new screen, leave Record Style set to Delimited with the Record Delimiter as \n. Change the Field Style to be Fixed Width. Finally, click Save.
    3. In the File Spec Editor, the left-hand panel is a tree where the specification will be built.
    4. Right-click on the root Node of the tree, called Base, and select Add New Record. In the dialog that pops up, enter Animal as the record name, and click OK.
    5. Right-click on the Animal record to add the following fields. After adding each field, set the length for that field in the configuration panel below.
      1. RecType (3)
      2. ID (5)
      3. Type (10)
      4. Name (10)
      5. Flavor (5)
    6. Right-click on the root node of the tree, called Base, and select Add New Record. In the dialog that pops up, enter Building as the record name, and click OK.
    7. Right-click on the Building record to add the following fields. After adding each field, set the length for that field in the configuration panel below.
      1. RecType (3)
      2. ID (5)
      3. Type (10)
      4. Value (6)
    8. Right-click on the root node of the tree, called Base, and select Add New Record. In the dialog that pops up, enter Employee as the record name, and click OK.
    9. Right-click on the Employee record to add the following fields. After adding each field, set the length for that field in the configuration panel below.
      1. RecType (3)
      2. ID (5)
      3. Type (10)
      4. Salary (8)
    10. Right-click on the root node of the tree, called Base, and select Add New Record. In the dialog that pops up, enter Unknown as the record name, and click OK.
    11. Right-click on the Unknown record to add the following fields. After adding each field, set the length for that field in the configuration panel below.
      1. Unknown (10)Create a File Spec

Create a Field Record Control

      1. Now that the spec is complete, right-click on the Base node at the root of the tree, and select Specify Record Control.Add Record Control
      2. From the dialog box that appears, click the Define new… button, to open a second dialog, Add new Record Control.
      3. In the Record Control Type selection box, choose Field Record Control. Then click Add Converter to save the changes.
    1. The Field Record Control item should be populated in the selection box in the Add Record Control Instance dialog. Click Select to save the changes.Add Record Control Instance
    2. Select the Field Record Control node that is now in the tree. The bottom panel should display a new configuration panel with its own tree.Field Record Control
    3. Right-click on Control Fields in the bottom panel, and choose Add. A dialog will appear. Type RecType in Field Name and 1 in Field Start and 3 in Field Length. Click OK.Control Fields
    4. Right-click on Control Cases in the bottom panel, and choose Add. A dialog will appear.
    5. For the Use Record field, input Animal. For Test Field, input RecType. For Value, input ANI. Input 2147483647 for Occurrences Limit. Click OK to save.Use Record
    6. Right-click on Control Cases again to add another case. In the dialog, for Use Record input Building, for Test Field input RecType, and for Value input BUI. Input 2147483647 for Occurrences Limit. Click OK to save.
    7. Right-click on Control Cases again to add another case. In the dialog, for Use Record input Employee, for Test Field input RecType, and for Value input EMP. Input 2147483647 for Occurrences Limit. Click OK to save.
    8. Right-click on the Default Case node, and select Define. In the dialog that appears, for Default Record Name, input Unknown. Input 2147483647 for Occurrences Limit. Click OK to save the changes.Default Case
    9. Click the Save icon in the toolbar above the tree. Enter people-file-spec as the name of the specification to save it.
    10. After saving it, press the X button in the top right of the screen to close the File Spec Editor and return to the Route Editing Grid.

Configure the Transport

    1. Select the Transport stage in the Route Editing Grid. The configuration panel will appear at the bottom.
    2. Select Directory / File from the Transport Type selection box. Optionally, click the button to open the Module Search Dialog, which provides a faster way to find the module you’re looking for.
    3. Select the Target Directory, using the button to open the file selector.
    4. Set farm-output as the Target File Name.
    5. Set xml as the Target File Extension.

Document the Target System

    1. Select the Target System stage in the Route Editing Grid. The configuration panel will appear at the bottom.
    2. Change the System Name to XML File
    3. Select the Choose Target Icon button, and scroll down to select one of the XML icons

Prepare to Test

    1. In the menu bar at the top, select Mode -> Testing Mode. Make sure the changes to the Route are saved.
    2. Copy the file called farm.txt from the Samples directory provided into the directory chosen as the polling directory.

Perform the Test

    1. At the top of the Testing Mode screen, select the Execute Test button.
    2. If the Route was configured successfully, all the Stages should light up with green checkmarks.
    3. In the OS File Explorer, open the directory selected as the Target Directory. The file farm-output.xml should be there, with the contents of the original file transformed into XML.

Output Files

    1. Compare the results from the exercise with the following example output files to see if they are correct.
      1. farm-output.xml

This is a unique website which will require a more modern browser to work! Please upgrade today!